Skip to content

Commit 022b32c

Browse files
psychedelicioushipsterusername
authored andcommitted
fix(ui): reset clip skip to 0 if new model is sdxl
Clip skip wasn't actually used in SDXL graphs so enabling it didn't do anything, just a UI quirk. Closes #5508
1 parent 653b820 commit 022b32c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

invokeai/frontend/web/src/features/parameters/store/generationSlice.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,15 @@ export const generationSlice = createSlice({
175175
}
176176

177177
// Clamp ClipSkip Based On Selected Model
178-
const { maxClip } = CLIP_SKIP_MAP[newModel.base_model];
179-
state.clipSkip = clamp(state.clipSkip, 0, maxClip);
178+
// TODO(psyche): remove this special handling when https://github.com/invoke-ai/InvokeAI/issues/4583 is resolved
179+
// WIP PR here: https://github.com/invoke-ai/InvokeAI/pull/4624
180+
if (newModel.base_model === 'sdxl') {
181+
// We don't support clip skip for SDXL yet - it's not in the graphs
182+
state.clipSkip = 0;
183+
} else {
184+
const { maxClip } = CLIP_SKIP_MAP[newModel.base_model];
185+
state.clipSkip = clamp(state.clipSkip, 0, maxClip);
186+
}
180187

181188
if (action.meta.previousModel?.base_model === newModel.base_model) {
182189
// The base model hasn't changed, we don't need to optimize the size

0 commit comments

Comments
 (0)