Skip to content

Commit 606f215

Browse files
committed
Move cfg scale out of diffusers block
Signed-off-by: Ettore Di Giacinto <[email protected]>
1 parent 354928b commit 606f215

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

core/backend/options.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func grpcModelOpts(c config.BackendConfig) *pb.ModelOptions {
122122
CUDA: c.CUDA || c.Diffusers.CUDA,
123123
SchedulerType: c.Diffusers.SchedulerType,
124124
PipelineType: c.Diffusers.PipelineType,
125-
CFGScale: c.Diffusers.CFGScale,
125+
CFGScale: c.CFGScale,
126126
LoraAdapter: c.LoraAdapter,
127127
LoraScale: c.LoraScale,
128128
LoraAdapters: c.LoraAdapters,

core/config/backend_config.go

+11-10
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,15 @@ type GRPC struct {
9999
}
100100

101101
type Diffusers struct {
102-
CUDA bool `yaml:"cuda"`
103-
PipelineType string `yaml:"pipeline_type"`
104-
SchedulerType string `yaml:"scheduler_type"`
105-
EnableParameters string `yaml:"enable_parameters"` // A list of comma separated parameters to specify
106-
CFGScale float32 `yaml:"cfg_scale"` // Classifier-Free Guidance Scale
107-
IMG2IMG bool `yaml:"img2img"` // Image to Image Diffuser
108-
ClipSkip int `yaml:"clip_skip"` // Skip every N frames
109-
ClipModel string `yaml:"clip_model"` // Clip model to use
110-
ClipSubFolder string `yaml:"clip_subfolder"` // Subfolder to use for clip model
111-
ControlNet string `yaml:"control_net"`
102+
CUDA bool `yaml:"cuda"`
103+
PipelineType string `yaml:"pipeline_type"`
104+
SchedulerType string `yaml:"scheduler_type"`
105+
EnableParameters string `yaml:"enable_parameters"` // A list of comma separated parameters to specify
106+
IMG2IMG bool `yaml:"img2img"` // Image to Image Diffuser
107+
ClipSkip int `yaml:"clip_skip"` // Skip every N frames
108+
ClipModel string `yaml:"clip_model"` // Clip model to use
109+
ClipSubFolder string `yaml:"clip_subfolder"` // Subfolder to use for clip model
110+
ControlNet string `yaml:"control_net"`
112111
}
113112

114113
// LLMConfig is a struct that holds the configuration that are
@@ -166,6 +165,8 @@ type LLMConfig struct {
166165
YarnAttnFactor float32 `yaml:"yarn_attn_factor"`
167166
YarnBetaFast float32 `yaml:"yarn_beta_fast"`
168167
YarnBetaSlow float32 `yaml:"yarn_beta_slow"`
168+
169+
CFGScale float32 `yaml:"cfg_scale"` // Classifier-Free Guidance Scale
169170
}
170171

171172
// AutoGPTQ is a struct that holds the configuration specific to the AutoGPTQ backend

docs/content/docs/features/image-generation.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,9 @@ diffusers:
194194
pipeline_type: StableDiffusionPipeline
195195
enable_parameters: "negative_prompt,num_inference_steps,clip_skip"
196196
scheduler_type: "k_dpmpp_sde"
197-
cfg_scale: 8
198197
clip_skip: 11
198+
199+
cfg_scale: 8
199200
```
200201

201202
#### Configuration parameters
@@ -302,7 +303,8 @@ cuda: true
302303
diffusers:
303304
pipeline_type: StableDiffusionDepth2ImgPipeline
304305
enable_parameters: "negative_prompt,num_inference_steps,image"
305-
cfg_scale: 6
306+
307+
cfg_scale: 6
306308
```
307309

308310
```bash

gallery/flux.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ config_file: |
1111
cuda: true
1212
enable_parameters: num_inference_steps
1313
pipeline_type: FluxPipeline
14-
cfg_scale: 0
14+
15+
cfg_scale: 0

0 commit comments

Comments
 (0)