Skip to content

Commit 9578db4

Browse files
fix(ui): Z-Image CFG guidance_scale check uses > 1 instead of > 0
Changed the guidance_scale check from > 0 to > 1 for Z-Image models. Since Z-Image uses guidance_scale=1.0 as "no CFG" (matching FLUX convention), negative conditioning should only be created when guidance_scale > 1.
1 parent e41a875 commit 9578db4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

invokeai/frontend/web/src/features/nodes/util/graph/generation/buildZImageGraph.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ export const buildZImageGraph = async (arg: GraphBuilderArg): Promise<GraphBuild
8282
id: getPrefixedId('pos_cond_collect'),
8383
});
8484

85-
// Z-Image supports negative conditioning when guidance_scale > 0
85+
// Z-Image supports negative conditioning when guidance_scale > 1
8686
// Only create negative conditioning nodes if guidance is used
8787
let negCond: Invocation<'z_image_text_encoder'> | null = null;
8888
let negCondCollect: Invocation<'collect'> | null = null;
89-
if (guidance_scale > 0) {
89+
if (guidance_scale > 1) {
9090
negCond = g.addNode({
9191
type: 'z_image_text_encoder',
9292
id: getPrefixedId('neg_prompt'),
@@ -130,7 +130,7 @@ export const buildZImageGraph = async (arg: GraphBuilderArg): Promise<GraphBuild
130130
g.addEdge(posCond, 'conditioning', posCondCollect, 'item');
131131
g.addEdge(posCondCollect, 'collection', denoise, 'positive_conditioning');
132132

133-
// Connect negative conditioning if guidance_scale > 0
133+
// Connect negative conditioning if guidance_scale > 1
134134
if (negCond !== null && negCondCollect !== null) {
135135
g.addEdge(modelLoader, 'qwen3_encoder', negCond, 'qwen3_encoder');
136136
g.addEdge(negCond, 'conditioning', negCondCollect, 'item');

0 commit comments

Comments
 (0)