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:
@ -46,6 +46,10 @@ export const addSDXLRefinerToGraph = (
|
|||||||
const { seamlessXAxis, seamlessYAxis, vaePrecision } = state.generation;
|
const { seamlessXAxis, seamlessYAxis, vaePrecision } = state.generation;
|
||||||
const { boundingBoxScaleMethod } = state.canvas;
|
const { boundingBoxScaleMethod } = state.canvas;
|
||||||
|
|
||||||
|
const isUsingScaledDimensions = ['auto', 'manual'].includes(
|
||||||
|
boundingBoxScaleMethod
|
||||||
|
);
|
||||||
|
|
||||||
if (!refinerModel) {
|
if (!refinerModel) {
|
||||||
return;
|
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 (
|
if (
|
||||||
graph.id === SDXL_CANVAS_INPAINT_GRAPH ||
|
graph.id === SDXL_CANVAS_INPAINT_GRAPH ||
|
||||||
graph.id === SDXL_CANVAS_OUTPAINT_GRAPH
|
graph.id === SDXL_CANVAS_OUTPAINT_GRAPH
|
||||||
@ -257,7 +234,7 @@ export const addSDXLRefinerToGraph = (
|
|||||||
fp32: vaePrecision === 'fp32' ? true : false,
|
fp32: vaePrecision === 'fp32' ? true : false,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (['auto', 'manual'].includes(boundingBoxScaleMethod)) {
|
if (isUsingScaledDimensions) {
|
||||||
graph.edges.push({
|
graph.edges.push({
|
||||||
source: {
|
source: {
|
||||||
node_id: INPAINT_IMAGE_RESIZE_UP,
|
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
|
// Add Refiner if enabled
|
||||||
if (shouldUseSDXLRefiner) {
|
if (shouldUseSDXLRefiner) {
|
||||||
addSDXLRefinerToGraph(state, graph, SDXL_DENOISE_LATENTS);
|
addSDXLRefinerToGraph(
|
||||||
|
state,
|
||||||
|
graph,
|
||||||
|
SDXL_DENOISE_LATENTS,
|
||||||
|
modelLoaderNodeId
|
||||||
|
);
|
||||||
if (seamlessXAxis || seamlessYAxis) {
|
if (seamlessXAxis || seamlessYAxis) {
|
||||||
modelLoaderNodeId = SDXL_REFINER_SEAMLESS;
|
modelLoaderNodeId = SDXL_REFINER_SEAMLESS;
|
||||||
}
|
}
|
||||||
|
@ -347,7 +347,12 @@ export const buildCanvasSDXLTextToImageGraph = (
|
|||||||
|
|
||||||
// Add Refiner if enabled
|
// Add Refiner if enabled
|
||||||
if (shouldUseSDXLRefiner) {
|
if (shouldUseSDXLRefiner) {
|
||||||
addSDXLRefinerToGraph(state, graph, SDXL_DENOISE_LATENTS);
|
addSDXLRefinerToGraph(
|
||||||
|
state,
|
||||||
|
graph,
|
||||||
|
SDXL_DENOISE_LATENTS,
|
||||||
|
modelLoaderNodeId
|
||||||
|
);
|
||||||
if (seamlessXAxis || seamlessYAxis) {
|
if (seamlessXAxis || seamlessYAxis) {
|
||||||
modelLoaderNodeId = SDXL_REFINER_SEAMLESS;
|
modelLoaderNodeId = SDXL_REFINER_SEAMLESS;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user