Skip to content

Commit 0280c9b

Browse files
fix(ui): generation_mode metadata not set correctly
1 parent ae8d1f2 commit 0280c9b

File tree

5 files changed

+20
-5
lines changed

5 files changed

+20
-5
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ export const buildCogView4Graph = async (
9494
assert(modelConfig.base === 'cogview4');
9595

9696
g.upsertMetadata({
97-
generation_mode: 'cogview4_txt2img',
9897
cfg_scale,
9998
width: originalSize.width,
10099
height: originalSize.height,
@@ -111,6 +110,7 @@ export const buildCogView4Graph = async (
111110

112111
if (generationMode === 'txt2img') {
113112
canvasOutput = addTextToImage({ g, l2i, originalSize, scaledSize });
113+
g.upsertMetadata({ generation_mode: 'cogview4_txt2img' });
114114
} else if (generationMode === 'img2img') {
115115
canvasOutput = await addImageToImage({
116116
g,
@@ -125,6 +125,7 @@ export const buildCogView4Graph = async (
125125
denoising_start,
126126
fp32: false,
127127
});
128+
g.upsertMetadata({ generation_mode: 'cogview4_img2img' });
128129
} else if (generationMode === 'inpaint') {
129130
canvasOutput = await addInpaint({
130131
state,
@@ -140,6 +141,7 @@ export const buildCogView4Graph = async (
140141
denoising_start,
141142
fp32: false,
142143
});
144+
g.upsertMetadata({ generation_mode: 'cogview4_inpaint' });
143145
} else if (generationMode === 'outpaint') {
144146
canvasOutput = await addOutpaint({
145147
state,
@@ -155,6 +157,7 @@ export const buildCogView4Graph = async (
155157
denoising_start,
156158
fp32: false,
157159
});
160+
g.upsertMetadata({ generation_mode: 'cogview4_outpaint' });
158161
} else {
159162
assert<Equals<typeof generationMode, never>>(false);
160163
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ export const buildFLUXGraph = async (
143143
addFLUXLoRAs(state, g, denoise, modelLoader, posCond);
144144

145145
g.upsertMetadata({
146-
generation_mode: 'flux_txt2img',
147146
guidance,
148147
width: originalSize.width,
149148
height: originalSize.height,
@@ -180,6 +179,7 @@ export const buildFLUXGraph = async (
180179
});
181180
} else if (generationMode === 'txt2img') {
182181
canvasOutput = addTextToImage({ g, l2i, originalSize, scaledSize });
182+
g.upsertMetadata({ generation_mode: 'flux_txt2img' });
183183
} else if (generationMode === 'img2img') {
184184
canvasOutput = await addImageToImage({
185185
g,
@@ -194,6 +194,7 @@ export const buildFLUXGraph = async (
194194
denoising_start,
195195
fp32: false,
196196
});
197+
g.upsertMetadata({ generation_mode: 'flux_img2img' });
197198
} else if (generationMode === 'inpaint') {
198199
canvasOutput = await addInpaint({
199200
state,
@@ -209,6 +210,7 @@ export const buildFLUXGraph = async (
209210
denoising_start,
210211
fp32: false,
211212
});
213+
g.upsertMetadata({ generation_mode: 'flux_inpaint' });
212214
} else if (generationMode === 'outpaint') {
213215
canvasOutput = await addOutpaint({
214216
state,
@@ -224,6 +226,7 @@ export const buildFLUXGraph = async (
224226
denoising_start,
225227
fp32: false,
226228
});
229+
g.upsertMetadata({ generation_mode: 'flux_outpaint' });
227230
} else {
228231
assert<Equals<typeof generationMode, never>>(false);
229232
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ export const buildSD1Graph = async (
140140
assert(model.base === 'sd-1' || model.base === 'sd-2');
141141

142142
g.upsertMetadata({
143-
generation_mode: 'txt2img',
144143
cfg_scale,
145144
cfg_rescale_multiplier,
146145
width: originalSize.width,
@@ -172,6 +171,7 @@ export const buildSD1Graph = async (
172171

173172
if (generationMode === 'txt2img') {
174173
canvasOutput = addTextToImage({ g, l2i, originalSize, scaledSize });
174+
g.upsertMetadata({ generation_mode: 'txt2img' });
175175
} else if (generationMode === 'img2img') {
176176
canvasOutput = await addImageToImage({
177177
g,
@@ -186,6 +186,7 @@ export const buildSD1Graph = async (
186186
denoising_start,
187187
fp32: vaePrecision === 'fp32',
188188
});
189+
g.upsertMetadata({ generation_mode: 'img2img' });
189190
} else if (generationMode === 'inpaint') {
190191
canvasOutput = await addInpaint({
191192
state,
@@ -201,6 +202,7 @@ export const buildSD1Graph = async (
201202
denoising_start,
202203
fp32: vaePrecision === 'fp32',
203204
});
205+
g.upsertMetadata({ generation_mode: 'inpaint' });
204206
} else if (generationMode === 'outpaint') {
205207
canvasOutput = await addOutpaint({
206208
state,
@@ -216,6 +218,7 @@ export const buildSD1Graph = async (
216218
denoising_start,
217219
fp32,
218220
});
221+
g.upsertMetadata({ generation_mode: 'outpaint' });
219222
} else {
220223
assert<Equals<typeof generationMode, never>>(false);
221224
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ export const buildSD3Graph = async (
109109
g.addEdge(denoise, 'latents', l2i, 'latents');
110110

111111
g.upsertMetadata({
112-
generation_mode: 'sd3_txt2img',
113112
cfg_scale,
114113
width: originalSize.width,
115114
height: originalSize.height,
@@ -136,6 +135,7 @@ export const buildSD3Graph = async (
136135

137136
if (generationMode === 'txt2img') {
138137
canvasOutput = addTextToImage({ g, l2i, originalSize, scaledSize });
138+
g.upsertMetadata({ generation_mode: 'sd3_txt2img' });
139139
} else if (generationMode === 'img2img') {
140140
canvasOutput = await addImageToImage({
141141
g,
@@ -150,6 +150,7 @@ export const buildSD3Graph = async (
150150
denoising_start,
151151
fp32: false,
152152
});
153+
g.upsertMetadata({ generation_mode: 'sd3_img2img' });
153154
} else if (generationMode === 'inpaint') {
154155
canvasOutput = await addInpaint({
155156
state,
@@ -165,6 +166,7 @@ export const buildSD3Graph = async (
165166
denoising_start,
166167
fp32: false,
167168
});
169+
g.upsertMetadata({ generation_mode: 'sd3_inpaint' });
168170
} else if (generationMode === 'outpaint') {
169171
canvasOutput = await addOutpaint({
170172
state,
@@ -180,6 +182,7 @@ export const buildSD3Graph = async (
180182
denoising_start,
181183
fp32: false,
182184
});
185+
g.upsertMetadata({ generation_mode: 'sd3_outpaint' });
183186
} else {
184187
assert<Equals<typeof generationMode, never>>(false);
185188
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ export const buildSDXLGraph = async (
140140
g.addEdge(denoise, 'latents', l2i, 'latents');
141141

142142
g.upsertMetadata({
143-
generation_mode: 'sdxl_txt2img',
144143
cfg_scale,
145144
cfg_rescale_multiplier,
146145
width: originalSize.width,
@@ -178,6 +177,7 @@ export const buildSDXLGraph = async (
178177

179178
if (generationMode === 'txt2img') {
180179
canvasOutput = addTextToImage({ g, l2i, originalSize, scaledSize });
180+
g.upsertMetadata({ generation_mode: 'sdxl_txt2img' });
181181
} else if (generationMode === 'img2img') {
182182
canvasOutput = await addImageToImage({
183183
g,
@@ -192,6 +192,7 @@ export const buildSDXLGraph = async (
192192
denoising_start,
193193
fp32,
194194
});
195+
g.upsertMetadata({ generation_mode: 'sdxl_img2img' });
195196
} else if (generationMode === 'inpaint') {
196197
canvasOutput = await addInpaint({
197198
state,
@@ -207,6 +208,7 @@ export const buildSDXLGraph = async (
207208
denoising_start,
208209
fp32,
209210
});
211+
g.upsertMetadata({ generation_mode: 'sdxl_inpaint' });
210212
} else if (generationMode === 'outpaint') {
211213
canvasOutput = await addOutpaint({
212214
state,
@@ -222,6 +224,7 @@ export const buildSDXLGraph = async (
222224
denoising_start,
223225
fp32,
224226
});
227+
g.upsertMetadata({ generation_mode: 'sdxl_outpaint' });
225228
} else {
226229
assert<Equals<typeof generationMode, never>>(false);
227230
}

0 commit comments

Comments
 (0)