mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix: SDXL T2I and L2I not respecting Scaled on Canvas
This commit is contained in:
parent
4bac36356a
commit
3cd2d3b764
@ -46,6 +46,10 @@ export const addSDXLRefinerToGraph = (
|
||||
const { seamlessXAxis, seamlessYAxis, vaePrecision } = state.generation;
|
||||
const { boundingBoxScaleMethod } = state.canvas;
|
||||
|
||||
const isUsingScaledDimensions = ['auto', 'manual'].includes(
|
||||
boundingBoxScaleMethod
|
||||
);
|
||||
|
||||
if (!refinerModel) {
|
||||
return;
|
||||
}
|
||||
@ -219,33 +223,6 @@ export const addSDXLRefinerToGraph = (
|
||||
}
|
||||
);
|
||||
|
||||
if (
|
||||
graph.id === SDXL_CANVAS_TEXT_TO_IMAGE_GRAPH ||
|
||||
graph.id === SDXL_CANVAS_IMAGE_TO_IMAGE_GRAPH
|
||||
) {
|
||||
graph.edges.push({
|
||||
source: {
|
||||
node_id: SDXL_REFINER_DENOISE_LATENTS,
|
||||
field: 'latents',
|
||||
},
|
||||
destination: {
|
||||
node_id: CANVAS_OUTPUT,
|
||||
field: 'latents',
|
||||
},
|
||||
});
|
||||
} else {
|
||||
graph.edges.push({
|
||||
source: {
|
||||
node_id: SDXL_REFINER_DENOISE_LATENTS,
|
||||
field: 'latents',
|
||||
},
|
||||
destination: {
|
||||
node_id: LATENTS_TO_IMAGE,
|
||||
field: 'latents',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
if (
|
||||
graph.id === SDXL_CANVAS_INPAINT_GRAPH ||
|
||||
graph.id === SDXL_CANVAS_OUTPAINT_GRAPH
|
||||
@ -257,7 +234,7 @@ export const addSDXLRefinerToGraph = (
|
||||
fp32: vaePrecision === 'fp32' ? true : false,
|
||||
};
|
||||
|
||||
if (['auto', 'manual'].includes(boundingBoxScaleMethod)) {
|
||||
if (isUsingScaledDimensions) {
|
||||
graph.edges.push({
|
||||
source: {
|
||||
node_id: INPAINT_IMAGE_RESIZE_UP,
|
||||
@ -300,4 +277,31 @@ export const addSDXLRefinerToGraph = (
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
graph.id === SDXL_CANVAS_TEXT_TO_IMAGE_GRAPH ||
|
||||
graph.id === SDXL_CANVAS_IMAGE_TO_IMAGE_GRAPH
|
||||
) {
|
||||
graph.edges.push({
|
||||
source: {
|
||||
node_id: SDXL_REFINER_DENOISE_LATENTS,
|
||||
field: 'latents',
|
||||
},
|
||||
destination: {
|
||||
node_id: isUsingScaledDimensions ? LATENTS_TO_IMAGE : CANVAS_OUTPUT,
|
||||
field: 'latents',
|
||||
},
|
||||
});
|
||||
} else {
|
||||
graph.edges.push({
|
||||
source: {
|
||||
node_id: SDXL_REFINER_DENOISE_LATENTS,
|
||||
field: 'latents',
|
||||
},
|
||||
destination: {
|
||||
node_id: LATENTS_TO_IMAGE,
|
||||
field: 'latents',
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
|
@ -367,7 +367,12 @@ export const buildCanvasSDXLImageToImageGraph = (
|
||||
|
||||
// Add Refiner if enabled
|
||||
if (shouldUseSDXLRefiner) {
|
||||
addSDXLRefinerToGraph(state, graph, SDXL_DENOISE_LATENTS);
|
||||
addSDXLRefinerToGraph(
|
||||
state,
|
||||
graph,
|
||||
SDXL_DENOISE_LATENTS,
|
||||
modelLoaderNodeId
|
||||
);
|
||||
if (seamlessXAxis || seamlessYAxis) {
|
||||
modelLoaderNodeId = SDXL_REFINER_SEAMLESS;
|
||||
}
|
||||
|
@ -347,7 +347,12 @@ export const buildCanvasSDXLTextToImageGraph = (
|
||||
|
||||
// Add Refiner if enabled
|
||||
if (shouldUseSDXLRefiner) {
|
||||
addSDXLRefinerToGraph(state, graph, SDXL_DENOISE_LATENTS);
|
||||
addSDXLRefinerToGraph(
|
||||
state,
|
||||
graph,
|
||||
SDXL_DENOISE_LATENTS,
|
||||
modelLoaderNodeId
|
||||
);
|
||||
if (seamlessXAxis || seamlessYAxis) {
|
||||
modelLoaderNodeId = SDXL_REFINER_SEAMLESS;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user