mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): do not run HRO if using an initial image
This commit is contained in:
parent
68d1458c83
commit
4beccea6e7
@ -6,11 +6,14 @@ import { assert } from 'tsafe';
|
||||
|
||||
import { IMAGE_TO_LATENTS, NOISE, RESIZE } from './constants';
|
||||
|
||||
/**
|
||||
* Returns true if an initial image was added, false if not.
|
||||
*/
|
||||
export const addInitialImageToLinearGraph = (
|
||||
state: RootState,
|
||||
graph: NonNullableGraph,
|
||||
denoiseNodeId: string
|
||||
): void => {
|
||||
): boolean => {
|
||||
// Remove Existing UNet Connections
|
||||
const { img2imgStrength, vaePrecision, model } = state.generation;
|
||||
const { refinerModel, refinerStart } = state.sdxl;
|
||||
@ -19,7 +22,7 @@ export const addInitialImageToLinearGraph = (
|
||||
const initialImage = initialImageLayer?.isEnabled ? initialImageLayer?.image : null;
|
||||
|
||||
if (!initialImage) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
const isSDXL = model?.base === 'sdxl';
|
||||
@ -122,4 +125,6 @@ export const addInitialImageToLinearGraph = (
|
||||
strength: img2imgStrength,
|
||||
init_image: initialImage.imageName,
|
||||
});
|
||||
|
||||
return true;
|
||||
};
|
||||
|
@ -232,7 +232,7 @@ export const buildGenerationTabGraph = async (state: RootState): Promise<NonNull
|
||||
LATENTS_TO_IMAGE
|
||||
);
|
||||
|
||||
addInitialImageToLinearGraph(state, graph, DENOISE_LATENTS);
|
||||
const didAddInitialImage = addInitialImageToLinearGraph(state, graph, DENOISE_LATENTS);
|
||||
|
||||
// Add Seamless To Graph
|
||||
if (seamlessXAxis || seamlessYAxis) {
|
||||
@ -249,7 +249,7 @@ export const buildGenerationTabGraph = async (state: RootState): Promise<NonNull
|
||||
await addControlLayersToGraph(state, graph, DENOISE_LATENTS);
|
||||
|
||||
// High resolution fix.
|
||||
if (state.hrf.hrfEnabled) {
|
||||
if (state.hrf.hrfEnabled && !didAddInitialImage) {
|
||||
addHrfToGraph(state, graph);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user