Revert "feat(ui): SDXL clip skip"

This reverts commit 40b4fa7238.
This commit is contained in:
psychedelicious 2024-05-18 07:54:42 +10:00 committed by Kent Keirsey
parent a18d7adad4
commit 07feb5ba07
4 changed files with 13 additions and 26 deletions

View File

@ -11,8 +11,6 @@ export const addSDXLLoRas = (
denoise: Invocation<'denoise_latents'>,
modelLoader: Invocation<'sdxl_model_loader'>,
seamless: Invocation<'seamless'> | null,
clipSkip: Invocation<'clip_skip'>,
clipSkip2: Invocation<'clip_skip'>,
posCond: Invocation<'sdxl_compel_prompt'>,
negCond: Invocation<'sdxl_compel_prompt'>
): void => {
@ -39,8 +37,8 @@ export const addSDXLLoRas = (
g.addEdge(loraCollector, 'collection', loraCollectionLoader, 'loras');
// Use seamless as UNet input if it exists, otherwise use the model loader
g.addEdge(seamless ?? modelLoader, 'unet', loraCollectionLoader, 'unet');
g.addEdge(clipSkip, 'clip', loraCollectionLoader, 'clip');
g.addEdge(clipSkip2, 'clip', loraCollectionLoader, 'clip2');
g.addEdge(modelLoader, 'clip', loraCollectionLoader, 'clip');
g.addEdge(modelLoader, 'clip2', loraCollectionLoader, 'clip2');
// Reroute UNet & CLIP connections through the LoRA collection loader
g.deleteEdgesTo(denoise, ['unet']);
g.deleteEdgesTo(posCond, ['clip', 'clip2']);

View File

@ -1,7 +1,6 @@
import type { RootState } from 'app/store/store';
import { fetchModelConfigWithTypeGuard } from 'features/metadata/util/modelFetchingHelpers';
import {
CLIP_SKIP,
LATENTS_TO_IMAGE,
NEGATIVE_CONDITIONING,
NEGATIVE_CONDITIONING_COLLECT,
@ -30,7 +29,6 @@ export const buildGenerationTabSDXLGraph = async (state: RootState): Promise<Non
model,
cfgScale: cfg_scale,
cfgRescaleMultiplier: cfg_rescale_multiplier,
clipSkip: skipped_layers,
scheduler,
seed,
steps,
@ -53,16 +51,6 @@ export const buildGenerationTabSDXLGraph = async (state: RootState): Promise<Non
id: SDXL_MODEL_LOADER,
model,
});
const clipSkip = g.addNode({
type: 'clip_skip',
id: CLIP_SKIP,
skipped_layers,
});
const clipSkip2 = g.addNode({
type: 'clip_skip',
id: `${CLIP_SKIP}_2`,
skipped_layers,
});
const posCond = g.addNode({
type: 'sdxl_compel_prompt',
id: POSITIVE_CONDITIONING,
@ -115,12 +103,10 @@ export const buildGenerationTabSDXLGraph = async (state: RootState): Promise<Non
let imageOutput: Invocation<'l2i'> | Invocation<'img_nsfw'> | Invocation<'img_watermark'> = l2i;
g.addEdge(modelLoader, 'unet', denoise, 'unet');
g.addEdge(modelLoader, 'clip', clipSkip, 'clip');
g.addEdge(modelLoader, 'clip2', clipSkip2, 'clip');
g.addEdge(clipSkip, 'clip', posCond, 'clip');
g.addEdge(clipSkip, 'clip', negCond, 'clip');
g.addEdge(clipSkip2, 'clip', posCond, 'clip2');
g.addEdge(clipSkip2, 'clip', negCond, 'clip2');
g.addEdge(modelLoader, 'clip', posCond, 'clip');
g.addEdge(modelLoader, 'clip', negCond, 'clip');
g.addEdge(modelLoader, 'clip2', posCond, 'clip2');
g.addEdge(modelLoader, 'clip2', negCond, 'clip2');
g.addEdge(posCond, 'conditioning', posCondCollect, 'item');
g.addEdge(negCond, 'conditioning', negCondCollect, 'item');
g.addEdge(posCondCollect, 'collection', denoise, 'positive_conditioning');
@ -146,13 +132,12 @@ export const buildGenerationTabSDXLGraph = async (state: RootState): Promise<Non
scheduler,
positive_style_prompt: positiveStylePrompt,
negative_style_prompt: negativeStylePrompt,
clip_skip: skipped_layers,
vae: vae ?? undefined,
});
const seamless = addSeamless(state, g, denoise, modelLoader, vaeLoader);
addSDXLLoRas(state, g, denoise, modelLoader, seamless, clipSkip, clipSkip2, posCond, negCond);
addSDXLLoRas(state, g, denoise, modelLoader, seamless, posCond, negCond);
// We might get the VAE from the main model, custom VAE, or seamless node.
const vaeSource = seamless ?? vaeLoader ?? modelLoader;

View File

@ -39,6 +39,10 @@ const ParamClipSkip = () => {
return CLIP_SKIP_MAP[model.base].markers;
}, [model]);
if (model?.base === 'sdxl') {
return null;
}
return (
<FormControl>
<InformationalPopover feature="clipSkip">

View File

@ -39,8 +39,8 @@ export const CLIP_SKIP_MAP = {
markers: [0, 1, 2, 3, 5, 10, 15, 20, 24],
},
sdxl: {
maxClip: 11,
markers: [0, 1, 2, 5, 11],
maxClip: 24,
markers: [0, 1, 2, 3, 5, 10, 15, 20, 24],
},
'sdxl-refiner': {
maxClip: 24,