1
1
import type { RootState } from 'app/store/store' ;
2
2
import { fetchModelConfigWithTypeGuard } from 'features/metadata/util/modelFetchingHelpers' ;
3
3
import {
4
+ CLIP_SKIP ,
4
5
LATENTS_TO_IMAGE ,
5
6
NEGATIVE_CONDITIONING ,
6
7
NEGATIVE_CONDITIONING_COLLECT ,
@@ -29,6 +30,7 @@ export const buildGenerationTabSDXLGraph = async (state: RootState): Promise<Non
29
30
model,
30
31
cfgScale : cfg_scale ,
31
32
cfgRescaleMultiplier : cfg_rescale_multiplier ,
33
+ clipSkip : skipped_layers ,
32
34
scheduler,
33
35
seed,
34
36
steps,
@@ -51,6 +53,16 @@ export const buildGenerationTabSDXLGraph = async (state: RootState): Promise<Non
51
53
id : SDXL_MODEL_LOADER ,
52
54
model,
53
55
} ) ;
56
+ const clipSkip = g . addNode ( {
57
+ type : 'clip_skip' ,
58
+ id : CLIP_SKIP ,
59
+ skipped_layers,
60
+ } ) ;
61
+ const clipSkip2 = g . addNode ( {
62
+ type : 'clip_skip' ,
63
+ id : `${ CLIP_SKIP } _2` ,
64
+ skipped_layers,
65
+ } ) ;
54
66
const posCond = g . addNode ( {
55
67
type : 'sdxl_compel_prompt' ,
56
68
id : POSITIVE_CONDITIONING ,
@@ -103,10 +115,12 @@ export const buildGenerationTabSDXLGraph = async (state: RootState): Promise<Non
103
115
let imageOutput : Invocation < 'l2i' > | Invocation < 'img_nsfw' > | Invocation < 'img_watermark' > = l2i ;
104
116
105
117
g . addEdge ( modelLoader , 'unet' , denoise , 'unet' ) ;
106
- g . addEdge ( modelLoader , 'clip' , posCond , 'clip' ) ;
107
- g . addEdge ( modelLoader , 'clip' , negCond , 'clip' ) ;
108
- g . addEdge ( modelLoader , 'clip2' , posCond , 'clip2' ) ;
109
- g . addEdge ( modelLoader , 'clip2' , negCond , 'clip2' ) ;
118
+ g . addEdge ( modelLoader , 'clip' , clipSkip , 'clip' ) ;
119
+ g . addEdge ( modelLoader , 'clip2' , clipSkip2 , 'clip' ) ;
120
+ g . addEdge ( clipSkip , 'clip' , posCond , 'clip' ) ;
121
+ g . addEdge ( clipSkip , 'clip' , negCond , 'clip' ) ;
122
+ g . addEdge ( clipSkip2 , 'clip' , posCond , 'clip2' ) ;
123
+ g . addEdge ( clipSkip2 , 'clip' , negCond , 'clip2' ) ;
110
124
g . addEdge ( posCond , 'conditioning' , posCondCollect , 'item' ) ;
111
125
g . addEdge ( negCond , 'conditioning' , negCondCollect , 'item' ) ;
112
126
g . addEdge ( posCondCollect , 'collection' , denoise , 'positive_conditioning' ) ;
@@ -132,12 +146,13 @@ export const buildGenerationTabSDXLGraph = async (state: RootState): Promise<Non
132
146
scheduler,
133
147
positive_style_prompt : positiveStylePrompt ,
134
148
negative_style_prompt : negativeStylePrompt ,
149
+ clip_skip : skipped_layers ,
135
150
vae : vae ?? undefined ,
136
151
} ) ;
137
152
138
153
const seamless = addSeamless ( state , g , denoise , modelLoader , vaeLoader ) ;
139
154
140
- addSDXLLoRas ( state , g , denoise , modelLoader , seamless , posCond , negCond ) ;
155
+ addSDXLLoRas ( state , g , denoise , modelLoader , seamless , clipSkip , clipSkip2 , posCond , negCond ) ;
141
156
142
157
// We might get the VAE from the main model, custom VAE, or seamless node.
143
158
const vaeSource = seamless ?? vaeLoader ?? modelLoader ;
0 commit comments