-
Notifications
You must be signed in to change notification settings - Fork 6
/
settings.debug.yaml
510 lines (407 loc) · 22.4 KB
/
settings.debug.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
# --------------------------------------------------------------------------------------------#
# STABLE DIFFUSION EXTENSION #
# This file contains the documentation and debug settings for the Stable Diffusion extension. #
# --------------------------------------------------------------------------------------------#
dark_theme: true
show_controls: true
mode: chat
chat_style: cai-chat
character: Assistant
preset: Debug-deterministic
seed: 1337
stream: true
default_extensions:
- gallery
- stable_diffusion
#----------------------#
# API ENDPOINT DETAILS #
#----------------------#
## Sets the API endpoint to use for generating images.
## If you are using the default stable-diffusion-webui settings, you do not need to change this.
stable_diffusion-api_endpoint: "http://127.0.0.1:7860/sdapi/v1"
## Leave as-is if you did not set up any authentication for the API.
stable_diffusion-api_username: ""
stable_diffusion-api_password: ""
#-----------------------------#
# IMAGE GENERATION PARAMETERS #
#-----------------------------#
stable_diffusion-base_prompt: "RAW photo, subject, 8k uhd, dslr, soft lighting, high quality, film grain, Fujifilm XT3"
stable_diffusion-base_negative_prompt: "(deformed iris, deformed pupils, semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime), text, cropped, out of frame, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck"
stable_diffusion-sampler_name: "DPM SDE"
stable_diffusion-sampling_steps: 25
stable_diffusion-width: 512
stable_diffusion-height: 512
stable_diffusion-cfg_scale: 6
stable_diffusion-clip_skip: 1
stable_diffusion-seed: -1
#------------------#
# USER PREFERENCES #
#------------------#
## Sets if debug mode (e.g. for additional logs) should be enabled
stable_diffusion-debug_mode_enabled: true
## Sets if generated images should be saved to the "outputs" folder inside the stable_diffusion extension directory.
stable_diffusion-save_images: true
## Defines how image generation should be triggered. Possible values:
## - "tool": Generate images using tool calls (requires special models and prompt modifications).
##
## This is overall the best and most accurate option, as the LLM model itself triggers and generates the prompt for image generation,
## similar to how ChatGPT does it. This is also the only option that supports image generation while remembering the chat history.
# However, it also the most difficult option to set up as it requires some special text generation models and some
## minor system prompt adjustments.
##
## Firstly you will need to use a model that supports function / tool calls like Command-R or Llama-2-chat-7b-hf-function-calling-v2.
## This option works best with models that are compatible to OpenAI tools spec. Once you have a found a suitable model, define two
## tools in your system prompt: add_text (with a "text" string parameter) and generate_image (with a "prompt" string parameter). Then
## instruct your chatbot or character to use these tools whenever needed.
##
## It is also highly recommended to either enable tool_mode_force_json_output_enabled or to force start the prompt directly in a JSON format
## like e.g. this start_with for Command-R:
##
## start_with: |-
## Action: ```json
## [
## {
## "tool_name": "generate_image",
## "parameters": {
## "prompt": "
##
## Consult the documentation for your model for more information regarding how tool / function calls work, how tools are setup and
## what the response must start with. For Command-R, see https://docs.cohere.com/docs/prompting-command-r.
##
## - "continuous": Generate images for all replies without any specific triggers.
## This option supports including the output text as image generation prompt but will ignore any past chat history.
##
## - "interactive": Generate images only if a message with a triggering text was sent or received.
## This option supports including the output text as image generation prompt but will also ignore any past chat history.
##
## - "manual": Generates images only if the image generation button was pressed.
## This option is currently not implemented and can be used as an off-switch until then.
stable_diffusion-trigger_mode: "tool"
## Forces model to output correct JSON for tool calls
## Only works with transformers / HF based loaders, ignored if using a different loader
stable_diffusion-tool_mode_force_json_output_enabled: false
stable_diffusion-tool_mode_force_json_output_schema: |-
{
"type": "array",
"items": {
"type": "object",
"properties": {
"tool_name": {
"type": "string"
},
"parameters": {
"type": "object",
"additionalProperties": {"type": "string"}
}
},
"required": ["tool_name", "parameters"]
}
}
## Set's how the prompt for image generation should be generated. Possible values:
## - "static": Uses the prompt option as-is ignoring any chat context.
## - "generated_text": Uses the generated output as-is as prompt.
## - "dynamic": Generates a dynamic prompt using the subject_regex, default_subject and description_prompt options.
## The result is combined with the base_prompt and base_negative_prompt options.
stable_diffusion-interactive_mode_prompt_generation_mode: "dynamic"
## Defines the regex pattern for the input message which triggers image generation in interactive mode.
stable_diffusion-interactive_mode_input_trigger_regex: >-
.*(draw|paint|create|send|upload|add|show|attach|generate)\b.+?\b(image|pic(ture)?|photo|snap(shot)?|selfie|meme)(s?)
## Defines the regex pattern for the generated output message which triggers image generation in interactive mode.
stable_diffusion-interactive_mode_output_trigger_regex: >-
.*[*([]?(draws|paints|creates|sends|uploads|adds|shows|attaches|generates|here (is|are))\b.+?\b(image|pic(ture)?|photo|snap(shot)?|selfie|meme)(s?)
## Defines the regex pattern for extracting the subject of the message for dynamic prompt generation in interactive mode.
## Only used when prompt_generation_mode is set to "dynamic".
stable_diffusion-interactive_mode_subject_regex: >-
.*\b(of)\b(.+?)(?:[.!?]|$)
## Sets the default subject to use instead if no subject was found in the input message using the subject_regex option.
## Only used when prompt_generation_mode is set to "dynamic".
stable_diffusion-interactive_mode_default_subject: "your appearance, your surroundings and what you are doing right now"
## The text to use for generating a stable diffusion compatible description of the given subject. Replaces the original input message.
## Only used when prompt_generation_mode is set to "dynamic".
stable_diffusion-interactive_mode_description_prompt: >
You are now a text generator for the Stable Diffusion AI image generator. You will generate a text prompt for it.
Describe [subject] using comma-separated tags only. Do not use sentences.
Include many tags such as tags for the environment, gender, clothes, age, location, light, daytime, angle, pose, etc.
Very important: only write the comma-separated tags. Do not write anything else. Do not ask any questions. Do not talk.
## Set's how the base prompt for image generation should be generated. Possible values:
## - "static": Uses the prompt option as-is ignoring any chat context.
## - "generated_text": Uses the generated output as-is as prompt.
## The result is combined with the base_prompt and base_negative_prompt options.
stable_diffusion-continuous_mode_prompt_generation_mode: "generated_text"
## If enabled, will automatically unload the LLM model from VRAM and then load the SD model instead when generating images.
## After the image is generated, it will unload the SD model again and then reload the LLM model.
## Saves VRAM but will slow down generation speed. Only recommended if you have a low amount of VRAM or use very large models.
stable_diffusion-dynamic_vram_reallocation_enabled: false
## Do not stream messages if generating images at the same time. Improves generation speed.
stable_diffusion-dont_stream_when_generating_images: true
## Defines regex based rules that triggers the given actions.
## regex: The regex pattern that triggers the action (optional)
## negative_regex: Do not trigger the action if the text matches this regex (optional)
## match: A list of where to match the regex. Available options:
## - "input": match on input text.
## - "input_sentence": match on any sentence in input text.
## - "output": match on generated output text.
## - "output_sentence": match on any sentence in generated output text.
## - "character_name": match on current character name (only if using gallery extension).
## actions: A list of actions to perform if the regex matches.
## - name: The name of the action to perform.
## Available options:
## - "prompt_append": appends the given text in "args" to the image generation prompt if an image is to be generated.
## - "negative_prompt_append": appends the given text in "args" to the image generation negative prompt if an image is to be generated.
## - "skip_generation": force skips any image generation.
## - "faceswaplab_enable": force enables face swap with FaceSwapLab.
## - "faceswaplab_disable": force disables face swap with FaceSwapLab.
## - "faceswaplab_set_source_face": sets source face for FaceSwapLab (requires "args" to be set to a valid source face).
## - "reactor_enable": force enables face swap with ReActor.
## - "reactor_disable": force disables face swap with ReActor.
## - "reactor_set_source_face": sets source face for ReActor (requires "args" to be set to a valid source face).
## - args: The arguments to pass to the action (optional).
stable_diffusion-generation_rules:
# Add details to the prompt if the input text or output text contains the word "detailed".
- regex: .*\b(detailed)\b
match: ["input", "output"]
actions:
- name: "prompt_append"
args: "(high resolution, detailed, realistic, vivid: 1.2), hdr, 8k, <lora:add_details:1>"
# Append a prompt and negative prompt describing the characters look if the character's name equals "Assistant".
- regex: ^Assistant$
match: ["character_name"]
actions:
- name: "prompt_append"
args: "small cute robot, monochrome, droid, 3d render, white reflective plastic body, simple, 3DMM, <lora:3DMM_V12:1>"
- name: "negative_prompt_append"
args: "humanoid, human, person, animal, anthropomorphic"
# Enable face swap via FaceSwapLab (see below for documentation) if the character's name equals "Example".
- regex: ^Example$
match: ["character_name"]
actions:
- name: "faceswaplab_enable"
- name: "faceswaplab_set_source_face"
args: "file:///{STABLE_DIFFUSION_EXTENSION_DIRECTORY}/assets/example_face.jpg"
#-----------------#
# POST PROCESSING #
#-----------------#
## Sets if generated images should be upscaled.
stable_diffusion-upscaling_enabled: false
## Sets the upscaler to use for upscaling generated images.
## Some examples are: Latent, LDSR, RealESRGAN 4x+, Lanczos, Nearest, etc.
stable_diffusion-upscaling_upscaler: "RealESRGAN 4x+"
## Amount to upscale by (1 = 100%, 2 = 200%, etc.).
stable_diffusion-upscaling_scale: 2
## Sets if HiRes.fix should be enabled.
stable_diffusion-hires_fix_enabled: false
## Sets the sampler to use for HiRes.fix.
stable_diffusion-hires_fix_sampler: "UniPC"
## Sets the amount of steps for HiRes.fix.
stable_diffusion-hires_sampling_steps: 10
## Sets the denoising strength for HiRes.fix.
stable_diffusion-hires_fix_denoising_strength: 0.2
## Sets if faces should be enhanced (or "restored") in generated images.
stable_diffusion-restore_faces_enabled: false
#-------------#
# FACESWAPLAB #
#-------------#
## Apply face swapping using FaceSwapLab.
## Requires the sd-webui-faceswaplab extension to be installed.
## Repository: https://github.com/glucauze/sd-webui-faceswaplab
## Sets if faces should be swapped in generated images.
stable_diffusion-faceswaplab_enabled: false
## Sets the source image with the face to use for face swapping.
## It's possible to set it in 3 ways:
## 1. Local file: "file:///./example.jpg"
## 2. URL: "https://some-site.com/example.png"
## 3. (recommended) FaceSwapLab face checkpoint: "checkpoint://example"
## You can see the list of available checkpoints in the "models/faceswaplab/faces" directory inside your Stable Diffusion WebUI directory.
## See https://github.com/glucauze/sd-webui-faceswaplab#build-and-use-checkpoints- for more on how to create face checkpoints.
stable_diffusion-faceswaplab_source_face: "file:///{STABLE_DIFFUSION_EXTENSION_DIRECTORY}/assets/example_face.jpg"
## Only swap faces if same gender.
stable_diffusion-faceswaplab_same_gender_only: true
## If enabled, order source faces by size.
## Otherwise, order source faces from left to right.
stable_diffusion-faceswaplab_sort_by_size: true
## Use the nth face in the source face image as reference face
## Note: the first face is 0, the second face is 1, etc.
##
## Example:
## If you have 3 faces in the source image and set this to 1, it will use the second face from left to right if sort_by_size is set to false.
## If sort_by_size is true, it will use the second largest face instead.
stable_diffusion-faceswaplab_source_face_index: 0
## Use the nth face in the generated image as the face to swap out
## See source_face_index for more info
stable_diffusion-faceswaplab_target_face_index: 0
## Sets if the face should be upscaled
stable_diffusion-faceswaplab_upscaling_enabled: false
## Sets the upscaler to use for upscaling faces
## Some examples are: Latent, LDSR, RealESRGAN 4x+, Lanczos, Nearest, etc.
stable_diffusion-faceswaplab_upscaling_upscaler: "RealESRGAN 4x+"
## Amount to upscale the face by (1 = 100%, 2 = 200%, etc.)
stable_diffusion-faceswaplab_upscaling_scale: 2
## Visibility of the upscaled face (0.0 - 1.0)
stable_diffusion-faceswaplab_upscaling_visibility: 1
## Sets if the final result should be upscaled
stable_diffusion-faceswaplab_postprocessing_upscaling_enabled: false
## Sets the upscaler to use for upscaling final result image after swapping
## Some examples are: Latent, LDSR, RealESRGAN 4x+, Lanczos, Nearest, etc.
stable_diffusion-faceswaplab_postprocessing_upscaling_upscaler: "RealESRGAN 4x+"
## Amount to upscale the final result by (1 = 100%, 2 = 200%, etc.)
stable_diffusion-faceswaplab_postprocessing_upscaling_scale: 2
## Visibility of the final result upscale (0.0 - 1.0)
stable_diffusion-faceswaplab_postprocessing_upscaling_visibility: 1
## Sets if the face should be enhanced (or "restored") during swapping
stable_diffusion-faceswaplab_restore_face_enabled: false
## Model to use for enhancing the face (CodeFormer, GFPGAN)
stable_diffusion-faceswaplab_restore_face_model: "CodeFormer"
## Visibility of the restored face (0.0 - 1.0)
stable_diffusion-faceswaplab_restore_face_visibility: 1
## Weight of the CodeFormer model (0.0 - 1.0)
stable_diffusion-faceswaplab_restore_face_codeformer_weight: 1
## Sets if the faces should be enhanced (or "restored") in the final result image after swapping
stable_diffusion-faceswaplab_postprocessing_restore_face_enabled: false
## Model to use for restoring the faces (CodeFormer, GFPGAN)
stable_diffusion-faceswaplab_postprocessing_restore_face_model: "CodeFormer"
## Visibility of the restored faces (0.0 - 1.0)
stable_diffusion-faceswaplab_postprocessing_restore_face_visibility: 1
## Weight of the CodeFormer model (0.0 - 1.0)
stable_diffusion-faceswaplab_postprocessing_restore_face_codeformer_weight: 1
## Sets if color corrections should be applied
stable_diffusion-faceswaplab_color_corrections_enabled: false
## Sets the erosion factor for the mask
stable_diffusion-faceswaplab_mask_erosion_factor: 1
## Use improved segmented mask (use pastenetto mask only the face )
## Note: you should enable upscaling if you enable this option
stable_diffusion-faceswaplab_mask_improved_mask_enabled: false
## Sharpen the face
stable_diffusion-faceswaplab_sharpen_face: false
## Sets if faces should be blended in generated images
stable_diffusion-faceswaplab_blend_faces: true
#---------#
# ReActor #
#---------#
## Apply face swapping using ReActor.
## Requires the sd-webui-reactor extension to be installed.
## Repository: https://github.com/Gourieff/sd-webui-reactor
## Sets if faces should be swapped in generated images.
stable_diffusion-reactor_enabled: true
## Sets the source image with the face to use for face swapping.
## It's possible to set it in 3 ways:
## 1. Local file: "file:///./example.jpg"
## 2. URL: "https://some-site.com/example.png"
## 3. (recommended) ReActor face model: "checkpoint://example"
## You can see the list of available checkpoints in the "models/reactor/faces" directory inside your Stable Diffusion WebUI directory.
stable_diffusion-reactor_source_face: "file:///{STABLE_DIFFUSION_EXTENSION_DIRECTORY}/assets/example_face.jpg"
## Sets the gender for the face in the source image (supported values: none, male, female)
## In other words, will only use the face with this gender as source face
stable_diffusion-reactor_source_gender: "none"
## Sets which gender to target in the generated image for swapping (supported values: none, male, female)
## In other words, will only swap a face of this gender
stable_diffusion-reactor_target_gender: "none"
## Use the nth face in the source face image as reference face
## Note: the first face is 0, the second face is 1, etc.
##
## Example:
## If you have 3 faces in the source image and set this to 1, it will use the second face from left to right and top to bottom.
stable_diffusion-reactor_source_face_index: 0
## Use the nth face in the generated image as the face to swap out
## See source_face_index for more info
stable_diffusion-reactor_target_face_index: 0
## Sets if the face should be enhanced (or "restored") after swapping
stable_diffusion-reactor_restore_face_enabled: false
## Model to use for restoring the face (CodeFormer, GFPGAN)
stable_diffusion-reactor_restore_face_model: "CodeFormer"
## Visibility of the restored face (0.0 - 1.0)
stable_diffusion-reactor_restore_face_visibility: 1
## Weight of the CodeFormer model (0.0 - 1.0)
stable_diffusion-reactor_restore_face_codeformer_weight: 1
## Upscale face first before enhancing it; otherwise restores face first then upscales it instead
stable_diffusion-reactor_restore_face_upscale_first: false
## Sets if the face should be upscaled.
stable_diffusion-reactor_upscaling_enabled: false
## Sets the upscaler to use for upscaling faces.
## Some examples are: Latent, LDSR, RealESRGAN 4x+, Lanczos, Nearest, etc.
stable_diffusion-reactor_upscaling_upscaler: "RealESRGAN 4x+"
## Amount to upscale the face by (1 = 100%, 2 = 200%, etc.).
stable_diffusion-reactor_upscaling_scale: 2
## Visibility of the upscaled face (0.0 - 1.0)
stable_diffusion-reactor_upscaling_visibility: 1
## Sets if face mask correction should be enabled to fix pixelation around face contours
stable_diffusion-reactor_mask_face: false
## Model to use for swapping faces
stable_diffusion-reactor_model: "inswapper_128.onnx"
## Device to use for swapping faces (CPU, CUDA).
## CUDA recommended for faster inference if you have an NVIDIA GPU.
## Note: CUDA requires installation of the onnxruntime-gpu package instead of onnxruntime in stable-diffusion-webui
stable_diffusion-reactor_device: "CPU"
#---------#
# FaceID #
#---------#
## Apply face swapping using FaceID feature of SD.Next (a fork of AUTOMATIC1111).
## See: https://github.com/vladmandic/automatic for SD.Next repository.
##
## Works much better than ReActor or FaceSwapLab as
## the face not actually swapped but instead directly
## generated like the source face while the image is
## still being generated.
##
## Works with stylized images too, e.g. 3D renders, drawings, cartoon, paintings etc.
##
## WARNING: DOES NOT WORK WITH VANILLA AUTOMATIC1111. YOU _MUST_ USE SD.NEXT INSTEAD.
##
## Requires "insightface", "ip_adapter" and "onnxruntime-gpu" PIP packages to be installed in SD.Next.
## Sets if faces should be swapped in generated images.
stable_diffusion-faceid_enabled: false
## Sets the source image with the face to use for face swapping.
## It's possible to set it in 2 difference ways:
## 1. Local file: "file:///./example.jpg"
## 2. URL: "https://some-site.com/example.png"
stable_diffusion-faceid_source_face: "file:///{STABLE_DIFFUSION_EXTENSION_DIRECTORY}/assets/example_face.jpg"
## FaceID mode
stable_diffusion-faceid_mode: ["FaceID", "FaceSwap"]
## Model to use for FaceID
## Available options:
## - FaceID Base
## - FaceID Plus
## - FaceID Plus v2
## - FaceID XL
stable_diffusion-faceid_model: "FaceID Plus v2"
## Use recommended sampler for FaceID
stable_diffusion-faceid_override_sampler: true
## Cache FaceID model for faster generation
stable_diffusion-faceid_cache_model: false
## FaceID strength (0.0 - 2.0)
stable_diffusion-faceid_strength: 1.0
## FaceID structure (0.0 - 1.0)
stable_diffusion-faceid_structure: 1.0
## FaceID rank (4 - 256)
stable_diffusion-faceid_rank: 128
## FaceID token count (1 - 16)
stable_diffusion-faceid_tokens: 4
#-------------#
# IP ADAPTER #
#-------------#
## Adjust the IP Adapter integration feature of SD.Next (a fork of AUTOMATIC1111).
## See: https://github.com/vladmandic/automatic for SD.Next repository.
## See: https://ip-adapter.github.io/ for IP Adapter paper.
##
## Can be used for face swapping as well similar to the FaceID feature
## (by using the "Plus Face" or the "Full face" adapter).
##
## WARNING: DOES NOT WORK WITH VANILLA AUTOMATIC1111. YOU _MUST_ USE SD.NEXT INSTEAD.
## Requires "ip_adapter" and "onnxruntime-gpu" PIP packages to be installed in SD.Next.
## Sets if IP adapter should be enabled.
stable_diffusion-ipadapter_enabled: false
## Sets the source image to use for face swapping.
## It's possible to set it in 2 difference ways:
## 1. Local file: "file:///./example.jpg"
## 2. URL: "https://some-site.com/example.png"
stable_diffusion-ipadapter_reference_image: "file:///{STABLE_DIFFUSION_EXTENSION_DIRECTORY}/assets/example_face.jpg"
## The adapter to use.
## Possible values:
## - "Base"
## - "Light"
## - "Plus"
## - "Plus Face"
## - "Full face"
## - "Base SDXL"
stable_diffusion-ipadapter_adapter: "Base"
## Scale for the source face during image generation (0.0 - 1.0)
stable_diffusion-ipadapter_scale: 0.5