mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
feat(ui): bump FLUX guidance up to 30 if it's too low during graph building
This commit is contained in:
@@ -49,8 +49,16 @@ export const buildFLUXGraph = async (
|
||||
|
||||
const model = selectMainModelConfig(state);
|
||||
|
||||
const { guidance, seed, steps, fluxVAE, t5EncoderModel, clipEmbedModel, img2imgStrength, optimizedDenoisingEnabled } =
|
||||
params;
|
||||
const {
|
||||
guidance: baseGuidance,
|
||||
seed,
|
||||
steps,
|
||||
fluxVAE,
|
||||
t5EncoderModel,
|
||||
clipEmbedModel,
|
||||
img2imgStrength,
|
||||
optimizedDenoisingEnabled,
|
||||
} = params;
|
||||
|
||||
assert(model, 'No model found in state');
|
||||
assert(model.base === 'flux', 'Model is not a FLUX model');
|
||||
@@ -59,13 +67,21 @@ export const buildFLUXGraph = async (
|
||||
assert(fluxVAE, 'No FLUX VAE model found in state');
|
||||
|
||||
const isFLUXFill = model.variant === 'inpaint';
|
||||
|
||||
let guidance = baseGuidance;
|
||||
if (isFLUXFill) {
|
||||
// TODO(psyche): Better error message - this appears in a toast
|
||||
assert(
|
||||
generationMode === 'inpaint' || generationMode === 'outpaint',
|
||||
'FLUX Fill is not compatible with Text to Image or Image to Image.'
|
||||
);
|
||||
|
||||
// FLUX Fill wants much higher guidance values than normal FLUX - silently "fix" the value for the user if it is
|
||||
// way too low.
|
||||
// TODO(psyche): Figure out a way to alert the user that this is happening - maybe return warnings from the graph
|
||||
// builder and toast them?
|
||||
if (guidance < 25) {
|
||||
guidance = 30;
|
||||
}
|
||||
}
|
||||
|
||||
const { positivePrompt } = getPresetModifiedPrompts(state);
|
||||
|
||||
Reference in New Issue
Block a user