Kain1999 commited on
Commit
8587ef6
·
1 Parent(s): 511b18b

Upload 24 files

Browse files
Files changed (24) hide show
  1. .gitignore +34 -0
  2. .pylintrc +3 -0
  3. CODEOWNERS +12 -0
  4. README.md +151 -3
  5. artists.csv +0 -0
  6. config.json +122 -0
  7. config.yaml +70 -0
  8. environment-wsl2.yaml +11 -0
  9. launch.py +295 -0
  10. params.txt +4 -0
  11. requirements.txt +32 -0
  12. requirements_versions.txt +28 -0
  13. screenshot.png +3 -0
  14. script.js +86 -0
  15. style.css +648 -0
  16. txt2img_Screenshot.png +3 -0
  17. ui-config.json +371 -0
  18. v1-inference.yaml +70 -0
  19. webui-macos-env.sh +19 -0
  20. webui-user.bat +8 -0
  21. webui-user.sh +46 -0
  22. webui.bat +74 -0
  23. webui.py +194 -0
  24. webui.sh +169 -0
.gitignore ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ __pycache__
2
+ *.ckpt
3
+ *.safetensors
4
+ *.pth
5
+ /ESRGAN/*
6
+ /SwinIR/*
7
+ /repositories
8
+ /venv
9
+ /tmp
10
+ /model.ckpt
11
+ /models/**/*
12
+ /GFPGANv1.3.pth
13
+ /gfpgan/weights/*.pth
14
+ /ui-config.json
15
+ /outputs
16
+ /config.json
17
+ /log
18
+ /webui.settings.bat
19
+ /embeddings
20
+ /styles.csv
21
+ /params.txt
22
+ /styles.csv.bak
23
+ /webui-user.bat
24
+ /webui-user.sh
25
+ /interrogate
26
+ /user.css
27
+ /.idea
28
+ notification.mp3
29
+ /SwinIR
30
+ /textual_inversion
31
+ .vscode
32
+ /extensions
33
+ /test/stdout.txt
34
+ /test/stderr.txt
.pylintrc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # See https://pylint.pycqa.org/en/latest/user_guide/messages/message_control.html
2
+ [MESSAGES CONTROL]
3
+ disable=C,R,W,E,I
CODEOWNERS ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ * @AUTOMATIC1111
2
+
3
+ # if you were managing a localization and were removed from this file, this is because
4
+ # the intended way to do localizations now is via extensions. See:
5
+ # https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Developing-extensions
6
+ # Make a repo with your localization and since you are still listed as a collaborator
7
+ # you can add it to the wiki page yourself. This change is because some people complained
8
+ # the git commit log is cluttered with things unrelated to almost everyone and
9
+ # because I believe this is the best overall for the project to handle localizations almost
10
+ # entirely without my oversight.
11
+
12
+
README.md CHANGED
@@ -1,3 +1,151 @@
1
- ---
2
- license: other
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Stable Diffusion web UI
2
+ A browser interface based on Gradio library for Stable Diffusion.
3
+
4
+ ![](txt2img_Screenshot.png)
5
+
6
+ Check the [custom scripts](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Custom-Scripts) wiki page for extra scripts developed by users.
7
+
8
+ ## Features
9
+ [Detailed feature showcase with images](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features):
10
+ - Original txt2img and img2img modes
11
+ - One click install and run script (but you still must install python and git)
12
+ - Outpainting
13
+ - Inpainting
14
+ - Color Sketch
15
+ - Prompt Matrix
16
+ - Stable Diffusion Upscale
17
+ - Attention, specify parts of text that the model should pay more attention to
18
+ - a man in a ((tuxedo)) - will pay more attention to tuxedo
19
+ - a man in a (tuxedo:1.21) - alternative syntax
20
+ - select text and press ctrl+up or ctrl+down to automatically adjust attention to selected text (code contributed by anonymous user)
21
+ - Loopback, run img2img processing multiple times
22
+ - X/Y plot, a way to draw a 2 dimensional plot of images with different parameters
23
+ - Textual Inversion
24
+ - have as many embeddings as you want and use any names you like for them
25
+ - use multiple embeddings with different numbers of vectors per token
26
+ - works with half precision floating point numbers
27
+ - train embeddings on 8GB (also reports of 6GB working)
28
+ - Extras tab with:
29
+ - GFPGAN, neural network that fixes faces
30
+ - CodeFormer, face restoration tool as an alternative to GFPGAN
31
+ - RealESRGAN, neural network upscaler
32
+ - ESRGAN, neural network upscaler with a lot of third party models
33
+ - SwinIR and Swin2SR([see here](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/2092)), neural network upscalers
34
+ - LDSR, Latent diffusion super resolution upscaling
35
+ - Resizing aspect ratio options
36
+ - Sampling method selection
37
+ - Adjust sampler eta values (noise multiplier)
38
+ - More advanced noise setting options
39
+ - Interrupt processing at any time
40
+ - 4GB video card support (also reports of 2GB working)
41
+ - Correct seeds for batches
42
+ - Live prompt token length validation
43
+ - Generation parameters
44
+ - parameters you used to generate images are saved with that image
45
+ - in PNG chunks for PNG, in EXIF for JPEG
46
+ - can drag the image to PNG info tab to restore generation parameters and automatically copy them into UI
47
+ - can be disabled in settings
48
+ - drag and drop an image/text-parameters to promptbox
49
+ - Read Generation Parameters Button, loads parameters in promptbox to UI
50
+ - Settings page
51
+ - Running arbitrary python code from UI (must run with --allow-code to enable)
52
+ - Mouseover hints for most UI elements
53
+ - Possible to change defaults/mix/max/step values for UI elements via text config
54
+ - Random artist button
55
+ - Tiling support, a checkbox to create images that can be tiled like textures
56
+ - Progress bar and live image generation preview
57
+ - Negative prompt, an extra text field that allows you to list what you don't want to see in generated image
58
+ - Styles, a way to save part of prompt and easily apply them via dropdown later
59
+ - Variations, a way to generate same image but with tiny differences
60
+ - Seed resizing, a way to generate same image but at slightly different resolution
61
+ - CLIP interrogator, a button that tries to guess prompt from an image
62
+ - Prompt Editing, a way to change prompt mid-generation, say to start making a watermelon and switch to anime girl midway
63
+ - Batch Processing, process a group of files using img2img
64
+ - Img2img Alternative, reverse Euler method of cross attention control
65
+ - Highres Fix, a convenience option to produce high resolution pictures in one click without usual distortions
66
+ - Reloading checkpoints on the fly
67
+ - Checkpoint Merger, a tab that allows you to merge up to 3 checkpoints into one
68
+ - [Custom scripts](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Custom-Scripts) with many extensions from community
69
+ - [Composable-Diffusion](https://energy-based-model.github.io/Compositional-Visual-Generation-with-Composable-Diffusion-Models/), a way to use multiple prompts at once
70
+ - separate prompts using uppercase `AND`
71
+ - also supports weights for prompts: `a cat :1.2 AND a dog AND a penguin :2.2`
72
+ - No token limit for prompts (original stable diffusion lets you use up to 75 tokens)
73
+ - DeepDanbooru integration, creates danbooru style tags for anime prompts
74
+ - [xformers](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Xformers), major speed increase for select cards: (add --xformers to commandline args)
75
+ - via extension: [History tab](https://github.com/yfszzx/stable-diffusion-webui-images-browser): view, direct and delete images conveniently within the UI
76
+ - Generate forever option
77
+ - Training tab
78
+ - hypernetworks and embeddings options
79
+ - Preprocessing images: cropping, mirroring, autotagging using BLIP or deepdanbooru (for anime)
80
+ - Clip skip
81
+ - Use Hypernetworks
82
+ - Use VAEs
83
+ - Estimated completion time in progress bar
84
+ - API
85
+ - Support for dedicated [inpainting model](https://github.com/runwayml/stable-diffusion#inpainting-with-stable-diffusion) by RunwayML.
86
+ - via extension: [Aesthetic Gradients](https://github.com/AUTOMATIC1111/stable-diffusion-webui-aesthetic-gradients), a way to generate images with a specific aesthetic by using clip images embds (implementation of [https://github.com/vicgalle/stable-diffusion-aesthetic-gradients](https://github.com/vicgalle/stable-diffusion-aesthetic-gradients))
87
+ - [Stable Diffusion 2.0](https://github.com/Stability-AI/stablediffusion) support - see [wiki](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#stable-diffusion-20) for instructions
88
+
89
+ ## Installation and Running
90
+ Make sure the required [dependencies](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Dependencies) are met and follow the instructions available for both [NVidia](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-NVidia-GPUs) (recommended) and [AMD](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-AMD-GPUs) GPUs.
91
+
92
+ Alternatively, use online services (like Google Colab):
93
+
94
+ - [List of Online Services](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Online-Services)
95
+
96
+ ### Automatic Installation on Windows
97
+ 1. Install [Python 3.10.6](https://www.python.org/downloads/windows/), checking "Add Python to PATH"
98
+ 2. Install [git](https://git-scm.com/download/win).
99
+ 3. Download the stable-diffusion-webui repository, for example by running `git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git`.
100
+ 4. Place `model.ckpt` in the `models` directory (see [dependencies](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Dependencies) for where to get it).
101
+ 5. _*(Optional)*_ Place `GFPGANv1.4.pth` in the base directory, alongside `webui.py` (see [dependencies](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Dependencies) for where to get it).
102
+ 6. Run `webui-user.bat` from Windows Explorer as normal, non-administrator, user.
103
+
104
+ ### Automatic Installation on Linux
105
+ 1. Install the dependencies:
106
+ ```bash
107
+ # Debian-based:
108
+ sudo apt install wget git python3 python3-venv
109
+ # Red Hat-based:
110
+ sudo dnf install wget git python3
111
+ # Arch-based:
112
+ sudo pacman -S wget git python3
113
+ ```
114
+ 2. To install in `/home/$(whoami)/stable-diffusion-webui/`, run:
115
+ ```bash
116
+ bash <(wget -qO- https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui/master/webui.sh)
117
+ ```
118
+
119
+ ### Installation on Apple Silicon
120
+
121
+ Find the instructions [here](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Installation-on-Apple-Silicon).
122
+
123
+ ## Contributing
124
+ Here's how to add code to this repo: [Contributing](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Contributing)
125
+
126
+ ## Documentation
127
+ The documentation was moved from this README over to the project's [wiki](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki).
128
+
129
+ ## Credits
130
+ - Stable Diffusion - https://github.com/CompVis/stable-diffusion, https://github.com/CompVis/taming-transformers
131
+ - k-diffusion - https://github.com/crowsonkb/k-diffusion.git
132
+ - GFPGAN - https://github.com/TencentARC/GFPGAN.git
133
+ - CodeFormer - https://github.com/sczhou/CodeFormer
134
+ - ESRGAN - https://github.com/xinntao/ESRGAN
135
+ - SwinIR - https://github.com/JingyunLiang/SwinIR
136
+ - Swin2SR - https://github.com/mv-lab/swin2sr
137
+ - LDSR - https://github.com/Hafiidz/latent-diffusion
138
+ - MiDaS - https://github.com/isl-org/MiDaS
139
+ - Ideas for optimizations - https://github.com/basujindal/stable-diffusion
140
+ - Cross Attention layer optimization - Doggettx - https://github.com/Doggettx/stable-diffusion, original idea for prompt editing.
141
+ - Cross Attention layer optimization - InvokeAI, lstein - https://github.com/invoke-ai/InvokeAI (originally http://github.com/lstein/stable-diffusion)
142
+ - Textual Inversion - Rinon Gal - https://github.com/rinongal/textual_inversion (we're not using his code, but we are using his ideas).
143
+ - Idea for SD upscale - https://github.com/jquesnelle/txt2imghd
144
+ - Noise generation for outpainting mk2 - https://github.com/parlance-zz/g-diffuser-bot
145
+ - CLIP interrogator idea and borrowing some code - https://github.com/pharmapsychotic/clip-interrogator
146
+ - Idea for Composable Diffusion - https://github.com/energy-based-model/Compositional-Visual-Generation-with-Composable-Diffusion-Models-PyTorch
147
+ - xformers - https://github.com/facebookresearch/xformers
148
+ - DeepDanbooru - interrogator for anime diffusers https://github.com/KichangKim/DeepDanbooru
149
+ - Security advice - RyotaK
150
+ - Initial Gradio script - posted on 4chan by an Anonymous user. Thank you Anonymous user.
151
+ - (You)
artists.csv ADDED
The diff for this file is too large to render. See raw diff
 
config.json ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "samples_save": true,
3
+ "samples_format": "png",
4
+ "samples_filename_pattern": "",
5
+ "grid_save": true,
6
+ "grid_format": "png",
7
+ "grid_extended_filename": false,
8
+ "grid_only_if_multiple": true,
9
+ "grid_prevent_empty_spots": false,
10
+ "n_rows": -1,
11
+ "enable_pnginfo": true,
12
+ "save_txt": false,
13
+ "save_images_before_face_restoration": false,
14
+ "jpeg_quality": 80,
15
+ "export_for_4chan": true,
16
+ "use_original_name_batch": false,
17
+ "save_selected_only": true,
18
+ "do_not_add_watermark": false,
19
+ "outdir_samples": "",
20
+ "outdir_txt2img_samples": "outputs/txt2img-images",
21
+ "outdir_img2img_samples": "outputs/img2img-images",
22
+ "outdir_extras_samples": "outputs/extras-images",
23
+ "outdir_grids": "",
24
+ "outdir_txt2img_grids": "outputs/txt2img-grids",
25
+ "outdir_img2img_grids": "outputs/img2img-grids",
26
+ "outdir_save": "log/images",
27
+ "save_to_dirs": false,
28
+ "grid_save_to_dirs": false,
29
+ "use_save_to_dirs_for_ui": false,
30
+ "directories_filename_pattern": "",
31
+ "directories_max_prompt_words": 8,
32
+ "ESRGAN_tile": 192,
33
+ "ESRGAN_tile_overlap": 8,
34
+ "realesrgan_enabled_models": [
35
+ "R-ESRGAN x4+",
36
+ "R-ESRGAN x4+ Anime6B"
37
+ ],
38
+ "SWIN_tile": 192,
39
+ "SWIN_tile_overlap": 8,
40
+ "ldsr_steps": 100,
41
+ "upscaler_for_img2img": "Lanczos",
42
+ "use_scale_latent_for_hires_fix": false,
43
+ "face_restoration_model": null,
44
+ "code_former_weight": 0.5,
45
+ "face_restoration_unload": false,
46
+ "memmon_poll_rate": 8,
47
+ "samples_log_stdout": false,
48
+ "multiple_tqdm": true,
49
+ "unload_models_when_training": true,
50
+ "dataset_filename_word_regex": "",
51
+ "dataset_filename_join_string": " ",
52
+ "training_image_repeats_per_epoch": 1,
53
+ "training_write_csv_every": 250,
54
+ "sd_model_checkpoint": "animefull-final-pruned.ckpt [925997e9]",
55
+ "sd_checkpoint_cache": 0,
56
+ "sd_hypernetwork": "None",
57
+ "sd_hypernetwork_strength": 1.0,
58
+ "img2img_color_correction": false,
59
+ "save_images_before_color_correction": false,
60
+ "img2img_fix_steps": false,
61
+ "enable_quantization": false,
62
+ "enable_emphasis": true,
63
+ "use_old_emphasis_implementation": false,
64
+ "enable_batch_seeds": true,
65
+ "comma_padding_backtrack": 20,
66
+ "filter_nsfw": false,
67
+ "CLIP_stop_at_last_layers": 2,
68
+ "random_artist_categories": [],
69
+ "interrogate_keep_models_in_memory": false,
70
+ "interrogate_use_builtin_artists": true,
71
+ "interrogate_return_ranks": false,
72
+ "interrogate_clip_num_beams": 1,
73
+ "interrogate_clip_min_length": 24,
74
+ "interrogate_clip_max_length": 48,
75
+ "interrogate_clip_dict_limit": 1500,
76
+ "interrogate_deepbooru_score_threshold": 0.65,
77
+ "deepbooru_sort_alpha": false,
78
+ "deepbooru_use_spaces": false,
79
+ "deepbooru_escape": true,
80
+ "show_progressbar": true,
81
+ "show_progress_every_n_steps": 0,
82
+ "return_grid": true,
83
+ "do_not_show_images": false,
84
+ "add_model_hash_to_info": true,
85
+ "add_model_name_to_info": false,
86
+ "font": "",
87
+ "js_modal_lightbox": true,
88
+ "js_modal_lightbox_initially_zoomed": true,
89
+ "show_progress_in_title": true,
90
+ "quicksettings": "sd_model_checkpoint,sd_hypernetwork,sd_hypernetwork_strength",
91
+ "localization": "zh_CN",
92
+ "hide_samplers": [],
93
+ "eta_ddim": 0.0,
94
+ "eta_ancestral": 0.67,
95
+ "ddim_discretize": "uniform",
96
+ "s_churn": 0.0,
97
+ "s_tmin": 0.0,
98
+ "s_noise": 1.0,
99
+ "eta_noise_seed_delta": 31337,
100
+ "sd_vae": "animevae",
101
+ "save_images_add_number": true,
102
+ "save_images_before_highres_fix": false,
103
+ "temp_dir": "",
104
+ "clean_temp_dir_at_start": false,
105
+ "ldsr_cached": false,
106
+ "pin_memory": false,
107
+ "save_optimizer_state": false,
108
+ "training_xattention_optimizations": false,
109
+ "sd_vae_as_default": false,
110
+ "inpainting_mask_weight": 1,
111
+ "initial_noise_multiplier": 1,
112
+ "show_progress_grid": true,
113
+ "disable_weights_auto_swap": false,
114
+ "send_seed": true,
115
+ "send_size": true,
116
+ "images_history_preload": false,
117
+ "images_record_paths": true,
118
+ "images_delete_message": true,
119
+ "images_history_page_columns": 6.0,
120
+ "images_history_page_rows": 6.0,
121
+ "images_history_pages_perload": 20.0
122
+ }
config.yaml ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ model:
2
+ base_learning_rate: 1.0e-04
3
+ target: ldm.models.diffusion.ddpm.LatentDiffusion
4
+ params:
5
+ linear_start: 0.00085
6
+ linear_end: 0.0120
7
+ num_timesteps_cond: 1
8
+ log_every_t: 200
9
+ timesteps: 1000
10
+ first_stage_key: "jpg"
11
+ cond_stage_key: "txt"
12
+ image_size: 64
13
+ channels: 4
14
+ cond_stage_trainable: false # Note: different from the one we trained before
15
+ conditioning_key: crossattn
16
+ monitor: val/loss_simple_ema
17
+ scale_factor: 0.18215
18
+ use_ema: False
19
+
20
+ scheduler_config: # 10000 warmup steps
21
+ target: ldm.lr_scheduler.LambdaLinearScheduler
22
+ params:
23
+ warm_up_steps: [ 10000 ]
24
+ cycle_lengths: [ 10000000000000 ] # incredibly large number to prevent corner cases
25
+ f_start: [ 1.e-6 ]
26
+ f_max: [ 1. ]
27
+ f_min: [ 1. ]
28
+
29
+ unet_config:
30
+ target: ldm.modules.diffusionmodules.openaimodel.UNetModel
31
+ params:
32
+ image_size: 32 # unused
33
+ in_channels: 4
34
+ out_channels: 4
35
+ model_channels: 320
36
+ attention_resolutions: [ 4, 2, 1 ]
37
+ num_res_blocks: 2
38
+ channel_mult: [ 1, 2, 4, 4 ]
39
+ num_heads: 8
40
+ use_spatial_transformer: True
41
+ transformer_depth: 1
42
+ context_dim: 768
43
+ use_checkpoint: True
44
+ legacy: False
45
+
46
+ first_stage_config:
47
+ target: ldm.models.autoencoder.AutoencoderKL
48
+ params:
49
+ embed_dim: 4
50
+ monitor: val/rec_loss
51
+ ddconfig:
52
+ double_z: true
53
+ z_channels: 4
54
+ resolution: 512
55
+ in_channels: 3
56
+ out_ch: 3
57
+ ch: 128
58
+ ch_mult:
59
+ - 1
60
+ - 2
61
+ - 4
62
+ - 4
63
+ num_res_blocks: 2
64
+ attn_resolutions: []
65
+ dropout: 0.0
66
+ lossconfig:
67
+ target: torch.nn.Identity
68
+
69
+ cond_stage_config:
70
+ target: ldm.modules.encoders.modules.FrozenCLIPEmbedder
environment-wsl2.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: automatic
2
+ channels:
3
+ - pytorch
4
+ - defaults
5
+ dependencies:
6
+ - python=3.10
7
+ - pip=22.2.2
8
+ - cudatoolkit=11.3
9
+ - pytorch=1.12.1
10
+ - torchvision=0.13.1
11
+ - numpy=1.23.1
launch.py ADDED
@@ -0,0 +1,295 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # this scripts installs necessary requirements and launches main program in webui.py
2
+ import subprocess
3
+ import os
4
+ import sys
5
+ import importlib.util
6
+ import shlex
7
+ import platform
8
+ import argparse
9
+ import json
10
+
11
+ dir_repos = "repositories"
12
+ dir_extensions = "extensions"
13
+ python = sys.executable
14
+ git = os.environ.get('GIT', "git")
15
+ index_url = os.environ.get('INDEX_URL', "")
16
+
17
+
18
+ def extract_arg(args, name):
19
+ return [x for x in args if x != name], name in args
20
+
21
+
22
+ def extract_opt(args, name):
23
+ opt = None
24
+ is_present = False
25
+ if name in args:
26
+ is_present = True
27
+ idx = args.index(name)
28
+ del args[idx]
29
+ if idx < len(args) and args[idx][0] != "-":
30
+ opt = args[idx]
31
+ del args[idx]
32
+ return args, is_present, opt
33
+
34
+
35
+ def run(command, desc=None, errdesc=None, custom_env=None):
36
+ if desc is not None:
37
+ print(desc)
38
+
39
+ result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, env=os.environ if custom_env is None else custom_env)
40
+
41
+ if result.returncode != 0:
42
+
43
+ message = f"""{errdesc or 'Error running command'}.
44
+ Command: {command}
45
+ Error code: {result.returncode}
46
+ stdout: {result.stdout.decode(encoding="utf8", errors="ignore") if len(result.stdout)>0 else '<empty>'}
47
+ stderr: {result.stderr.decode(encoding="utf8", errors="ignore") if len(result.stderr)>0 else '<empty>'}
48
+ """
49
+ raise RuntimeError(message)
50
+
51
+ return result.stdout.decode(encoding="utf8", errors="ignore")
52
+
53
+
54
+ def check_run(command):
55
+ result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
56
+ return result.returncode == 0
57
+
58
+
59
+ def is_installed(package):
60
+ try:
61
+ spec = importlib.util.find_spec(package)
62
+ except ModuleNotFoundError:
63
+ return False
64
+
65
+ return spec is not None
66
+
67
+
68
+ def repo_dir(name):
69
+ return os.path.join(dir_repos, name)
70
+
71
+
72
+ def run_python(code, desc=None, errdesc=None):
73
+ return run(f'"{python}" -c "{code}"', desc, errdesc)
74
+
75
+
76
+ def run_pip(args, desc=None):
77
+ index_url_line = f' --index-url {index_url}' if index_url != '' else ''
78
+ return run(f'"{python}" -m pip {args} --prefer-binary{index_url_line}', desc=f"Installing {desc}", errdesc=f"Couldn't install {desc}")
79
+
80
+
81
+ def check_run_python(code):
82
+ return check_run(f'"{python}" -c "{code}"')
83
+
84
+
85
+ def git_clone(url, dir, name, commithash=None):
86
+ # TODO clone into temporary dir and move if successful
87
+
88
+ if os.path.exists(dir):
89
+ if commithash is None:
90
+ return
91
+
92
+ current_hash = run(f'"{git}" -C {dir} rev-parse HEAD', None, f"Couldn't determine {name}'s hash: {commithash}").strip()
93
+ if current_hash == commithash:
94
+ return
95
+
96
+ run(f'"{git}" -C {dir} fetch', f"Fetching updates for {name}...", f"Couldn't fetch {name}")
97
+ run(f'"{git}" -C {dir} checkout {commithash}', f"Checking out commit for {name} with hash: {commithash}...", f"Couldn't checkout commit {commithash} for {name}")
98
+ return
99
+
100
+ run(f'"{git}" clone "{url}" "{dir}"', f"Cloning {name} into {dir}...", f"Couldn't clone {name}")
101
+
102
+ if commithash is not None:
103
+ run(f'"{git}" -C {dir} checkout {commithash}', None, "Couldn't checkout {name}'s hash: {commithash}")
104
+
105
+
106
+ def version_check(commit):
107
+ try:
108
+ import requests
109
+ commits = requests.get('https://api.github.com/repos/AUTOMATIC1111/stable-diffusion-webui/branches/master').json()
110
+ if commit != "<none>" and commits['commit']['sha'] != commit:
111
+ print("--------------------------------------------------------")
112
+ print("| You are not up to date with the most recent release. |")
113
+ print("| Consider running `git pull` to update. |")
114
+ print("--------------------------------------------------------")
115
+ elif commits['commit']['sha'] == commit:
116
+ print("You are up to date with the most recent release.")
117
+ else:
118
+ print("Not a git clone, can't perform version check.")
119
+ except Exception as e:
120
+ print("version check failed", e)
121
+
122
+
123
+ def run_extension_installer(extension_dir):
124
+ path_installer = os.path.join(extension_dir, "install.py")
125
+ if not os.path.isfile(path_installer):
126
+ return
127
+
128
+ try:
129
+ env = os.environ.copy()
130
+ env['PYTHONPATH'] = os.path.abspath(".")
131
+
132
+ print(run(f'"{python}" "{path_installer}"', errdesc=f"Error running install.py for extension {extension_dir}", custom_env=env))
133
+ except Exception as e:
134
+ print(e, file=sys.stderr)
135
+
136
+
137
+ def list_extensions(settings_file):
138
+ settings = {}
139
+
140
+ try:
141
+ if os.path.isfile(settings_file):
142
+ with open(settings_file, "r", encoding="utf8") as file:
143
+ settings = json.load(file)
144
+ except Exception as e:
145
+ print(e, file=sys.stderr)
146
+
147
+ disabled_extensions = set(settings.get('disabled_extensions', []))
148
+
149
+ return [x for x in os.listdir(dir_extensions) if x not in disabled_extensions]
150
+
151
+
152
+ def run_extensions_installers(settings_file):
153
+ if not os.path.isdir(dir_extensions):
154
+ return
155
+
156
+ for dirname_extension in list_extensions(settings_file):
157
+ run_extension_installer(os.path.join(dir_extensions, dirname_extension))
158
+
159
+
160
+ def prepare_environment():
161
+ torch_command = os.environ.get('TORCH_COMMAND', "pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113")
162
+ requirements_file = os.environ.get('REQS_FILE', "requirements_versions.txt")
163
+ commandline_args = os.environ.get('COMMANDLINE_ARGS', "")
164
+
165
+ gfpgan_package = os.environ.get('GFPGAN_PACKAGE', "git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379")
166
+ clip_package = os.environ.get('CLIP_PACKAGE', "git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1")
167
+ openclip_package = os.environ.get('OPENCLIP_PACKAGE', "git+https://github.com/mlfoundations/open_clip.git@bb6e834e9c70d9c27d0dc3ecedeebeaeb1ffad6b")
168
+
169
+ xformers_windows_package = os.environ.get('XFORMERS_WINDOWS_PACKAGE', 'https://github.com/C43H66N12O12S2/stable-diffusion-webui/releases/download/f/xformers-0.0.14.dev0-cp310-cp310-win_amd64.whl')
170
+
171
+ stable_diffusion_repo = os.environ.get('STABLE_DIFFUSION_REPO', "https://github.com/Stability-AI/stablediffusion.git")
172
+ taming_transformers_repo = os.environ.get('TAMING_TRANSFORMERS_REPO', "https://github.com/CompVis/taming-transformers.git")
173
+ k_diffusion_repo = os.environ.get('K_DIFFUSION_REPO', 'https://github.com/crowsonkb/k-diffusion.git')
174
+ codeformer_repo = os.environ.get('CODEFORMER_REPO', 'https://github.com/sczhou/CodeFormer.git')
175
+ blip_repo = os.environ.get('BLIP_REPO', 'https://github.com/salesforce/BLIP.git')
176
+
177
+ stable_diffusion_commit_hash = os.environ.get('STABLE_DIFFUSION_COMMIT_HASH', "47b6b607fdd31875c9279cd2f4f16b92e4ea958e")
178
+ taming_transformers_commit_hash = os.environ.get('TAMING_TRANSFORMERS_COMMIT_HASH', "24268930bf1dce879235a7fddd0b2355b84d7ea6")
179
+ k_diffusion_commit_hash = os.environ.get('K_DIFFUSION_COMMIT_HASH', "5b3af030dd83e0297272d861c19477735d0317ec")
180
+ codeformer_commit_hash = os.environ.get('CODEFORMER_COMMIT_HASH', "c5b4593074ba6214284d6acd5f1719b6c5d739af")
181
+ blip_commit_hash = os.environ.get('BLIP_COMMIT_HASH', "48211a1594f1321b00f14c9f7a5b4813144b2fb9")
182
+
183
+ sys.argv += shlex.split(commandline_args)
184
+
185
+ parser = argparse.ArgumentParser()
186
+ parser.add_argument("--ui-settings-file", type=str, help="filename to use for ui settings", default='config.json')
187
+ args, _ = parser.parse_known_args(sys.argv)
188
+
189
+ sys.argv, _ = extract_arg(sys.argv, '-f')
190
+ sys.argv, skip_torch_cuda_test = extract_arg(sys.argv, '--skip-torch-cuda-test')
191
+ sys.argv, reinstall_xformers = extract_arg(sys.argv, '--reinstall-xformers')
192
+ sys.argv, update_check = extract_arg(sys.argv, '--update-check')
193
+ sys.argv, run_tests, test_dir = extract_opt(sys.argv, '--tests')
194
+ xformers = '--xformers' in sys.argv
195
+ ngrok = '--ngrok' in sys.argv
196
+
197
+ try:
198
+ commit = run(f"{git} rev-parse HEAD").strip()
199
+ except Exception:
200
+ commit = "<none>"
201
+
202
+ print(f"Python {sys.version}")
203
+ print(f"Commit hash: {commit}")
204
+
205
+ if not is_installed("torch") or not is_installed("torchvision"):
206
+ run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch")
207
+
208
+ if not skip_torch_cuda_test:
209
+ run_python("import torch; assert torch.cuda.is_available(), 'Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check'")
210
+
211
+ if not is_installed("gfpgan"):
212
+ run_pip(f"install {gfpgan_package}", "gfpgan")
213
+
214
+ if not is_installed("clip"):
215
+ run_pip(f"install {clip_package}", "clip")
216
+
217
+ if not is_installed("open_clip"):
218
+ run_pip(f"install {openclip_package}", "open_clip")
219
+
220
+ if (not is_installed("xformers") or reinstall_xformers) and xformers:
221
+ if platform.system() == "Windows":
222
+ if platform.python_version().startswith("3.10"):
223
+ run_pip(f"install -U -I --no-deps {xformers_windows_package}", "xformers")
224
+ else:
225
+ print("Installation of xformers is not supported in this version of Python.")
226
+ print("You can also check this and build manually: https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Xformers#building-xformers-on-windows-by-duckness")
227
+ if not is_installed("xformers"):
228
+ exit(0)
229
+ elif platform.system() == "Linux":
230
+ run_pip("install xformers", "xformers")
231
+
232
+ if not is_installed("pyngrok") and ngrok:
233
+ run_pip("install pyngrok", "ngrok")
234
+
235
+ os.makedirs(dir_repos, exist_ok=True)
236
+
237
+ git_clone(stable_diffusion_repo, repo_dir('stable-diffusion-stability-ai'), "Stable Diffusion", stable_diffusion_commit_hash)
238
+ git_clone(taming_transformers_repo, repo_dir('taming-transformers'), "Taming Transformers", taming_transformers_commit_hash)
239
+ git_clone(k_diffusion_repo, repo_dir('k-diffusion'), "K-diffusion", k_diffusion_commit_hash)
240
+ git_clone(codeformer_repo, repo_dir('CodeFormer'), "CodeFormer", codeformer_commit_hash)
241
+ git_clone(blip_repo, repo_dir('BLIP'), "BLIP", blip_commit_hash)
242
+
243
+ if not is_installed("lpips"):
244
+ run_pip(f"install -r {os.path.join(repo_dir('CodeFormer'), 'requirements.txt')}", "requirements for CodeFormer")
245
+
246
+ run_pip(f"install -r {requirements_file}", "requirements for Web UI")
247
+
248
+ run_extensions_installers(settings_file=args.ui_settings_file)
249
+
250
+ if update_check:
251
+ version_check(commit)
252
+
253
+ if "--exit" in sys.argv:
254
+ print("Exiting because of --exit argument")
255
+ exit(0)
256
+
257
+ if run_tests:
258
+ exitcode = tests(test_dir)
259
+ exit(exitcode)
260
+
261
+
262
+ def tests(test_dir):
263
+ if "--api" not in sys.argv:
264
+ sys.argv.append("--api")
265
+ if "--ckpt" not in sys.argv:
266
+ sys.argv.append("--ckpt")
267
+ sys.argv.append("./test/test_files/empty.pt")
268
+ if "--skip-torch-cuda-test" not in sys.argv:
269
+ sys.argv.append("--skip-torch-cuda-test")
270
+
271
+ print(f"Launching Web UI in another process for testing with arguments: {' '.join(sys.argv[1:])}")
272
+
273
+ with open('test/stdout.txt', "w", encoding="utf8") as stdout, open('test/stderr.txt', "w", encoding="utf8") as stderr:
274
+ proc = subprocess.Popen([sys.executable, *sys.argv], stdout=stdout, stderr=stderr)
275
+
276
+ import test.server_poll
277
+ exitcode = test.server_poll.run_tests(proc, test_dir)
278
+
279
+ print(f"Stopping Web UI process with id {proc.pid}")
280
+ proc.kill()
281
+ return exitcode
282
+
283
+
284
+ def start():
285
+ print(f"Launching {'API server' if '--nowebui' in sys.argv else 'Web UI'} with arguments: {' '.join(sys.argv[1:])}")
286
+ import webui
287
+ if '--nowebui' in sys.argv:
288
+ webui.api_only()
289
+ else:
290
+ webui.webui()
291
+
292
+
293
+ if __name__ == "__main__":
294
+ prepare_environment()
295
+ start()
params.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ (illustration:1.8),(best quality),(masterpiece:1.5),masterpiece,png,(extremely detailed CG unity 8k wallpaper), (colorful),warm,Chinese style,(ink splashing),(color splashing),((watercolor)),(1 Chinese girl:1.8),solo, depth of field,dramatic angle,(Silver detailed cyan_ribbon and white flowers in the girl's long black_hair:1.25), (detailed black_hair:1.35), ,((gold_black Taoist robes:1.35)),(braid), (detailed beautiful face:1.3),detailed symmetrical_Blue_eyes,,
2
+ (Ancient palace background far away:1.55),A slight light, (pink flower:1.2),chiaroscuro, ((lotus) in beautiful detailed flowing_clouds_sea:1.3), Rayleigh scattering,(feather headdress:1.15)
3
+ Negative prompt: negative,nsfw,text,ugly,trannsexual,extra fingers,fused fingers,too many fingers,long neck,mutated hands,poorly drawn hands,poorly drawn face,deformed,blurry,bad anatomy,malformed limbs,gross proportions,mutated breasts,Curled up,Single color,Too many legs,Wrong human body structure,full body,Limb dislocation,bad proportions,more than 2 knee,Extra arms,lowres,bad anatomy,bad hands,text,error,missing fingers,extra digit,fewer digits,cropped,worst quality,low quality,normal quality,jpeg artifacts,signature,watermark,username,blurry,missing fingers,bad hands,missing arms
4
+ Steps: 50, Sampler: DDIM, CFG scale: 6, Seed: 1409808235, Size: 1024x768, Model hash: 925997e9, Clip skip: 2, ENSD: 31337
requirements.txt ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ accelerate
2
+ basicsr
3
+ fairscale==0.4.4
4
+ fonts
5
+ font-roboto
6
+ gfpgan
7
+ gradio==3.9
8
+ invisible-watermark
9
+ numpy
10
+ omegaconf
11
+ opencv-python
12
+ requests
13
+ piexif
14
+ Pillow
15
+ pytorch_lightning==1.7.7
16
+ realesrgan
17
+ scikit-image>=0.19
18
+ timm==0.4.12
19
+ transformers==4.19.2
20
+ torch
21
+ einops
22
+ jsonmerge
23
+ clean-fid
24
+ resize-right
25
+ torchdiffeq
26
+ kornia
27
+ lark
28
+ inflection
29
+ GitPython
30
+ torchsde
31
+ safetensors
32
+ psutil; sys_platform == 'darwin'
requirements_versions.txt ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ transformers==4.19.2
2
+ accelerate==0.12.0
3
+ basicsr==1.4.2
4
+ gfpgan==1.3.8
5
+ gradio==3.9
6
+ numpy==1.23.3
7
+ Pillow==9.2.0
8
+ realesrgan==0.3.0
9
+ torch
10
+ omegaconf==2.2.3
11
+ pytorch_lightning==1.7.6
12
+ scikit-image==0.19.2
13
+ fonts
14
+ font-roboto
15
+ timm==0.6.7
16
+ fairscale==0.4.9
17
+ piexif==1.1.3
18
+ einops==0.4.1
19
+ jsonmerge==1.8.0
20
+ clean-fid==0.1.29
21
+ resize-right==0.0.2
22
+ torchdiffeq==0.2.3
23
+ kornia==0.6.7
24
+ lark==1.1.2
25
+ inflection==0.5.1
26
+ GitPython==3.1.27
27
+ torchsde==0.2.5
28
+ safetensors==0.2.5
screenshot.png ADDED

Git LFS Details

  • SHA256: a7c54f54c6602bf301f41fd71e251369f7caaf0b054df3a7c85d2cc292b1e143
  • Pointer size: 131 Bytes
  • Size of remote file: 525 kB
script.js ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function gradioApp() {
2
+ const gradioShadowRoot = document.getElementsByTagName('gradio-app')[0].shadowRoot
3
+ return !!gradioShadowRoot ? gradioShadowRoot : document;
4
+ }
5
+
6
+ function get_uiCurrentTab() {
7
+ return gradioApp().querySelector('.tabs button:not(.border-transparent)')
8
+ }
9
+
10
+ function get_uiCurrentTabContent() {
11
+ return gradioApp().querySelector('.tabitem[id^=tab_]:not([style*="display: none"])')
12
+ }
13
+
14
+ uiUpdateCallbacks = []
15
+ uiTabChangeCallbacks = []
16
+ let uiCurrentTab = null
17
+
18
+ function onUiUpdate(callback){
19
+ uiUpdateCallbacks.push(callback)
20
+ }
21
+ function onUiTabChange(callback){
22
+ uiTabChangeCallbacks.push(callback)
23
+ }
24
+
25
+ function runCallback(x, m){
26
+ try {
27
+ x(m)
28
+ } catch (e) {
29
+ (console.error || console.log).call(console, e.message, e);
30
+ }
31
+ }
32
+ function executeCallbacks(queue, m) {
33
+ queue.forEach(function(x){runCallback(x, m)})
34
+ }
35
+
36
+ document.addEventListener("DOMContentLoaded", function() {
37
+ var mutationObserver = new MutationObserver(function(m){
38
+ executeCallbacks(uiUpdateCallbacks, m);
39
+ const newTab = get_uiCurrentTab();
40
+ if ( newTab && ( newTab !== uiCurrentTab ) ) {
41
+ uiCurrentTab = newTab;
42
+ executeCallbacks(uiTabChangeCallbacks);
43
+ }
44
+ });
45
+ mutationObserver.observe( gradioApp(), { childList:true, subtree:true })
46
+ });
47
+
48
+ /**
49
+ * Add a ctrl+enter as a shortcut to start a generation
50
+ */
51
+ document.addEventListener('keydown', function(e) {
52
+ var handled = false;
53
+ if (e.key !== undefined) {
54
+ if((e.key == "Enter" && (e.metaKey || e.ctrlKey || e.altKey))) handled = true;
55
+ } else if (e.keyCode !== undefined) {
56
+ if((e.keyCode == 13 && (e.metaKey || e.ctrlKey || e.altKey))) handled = true;
57
+ }
58
+ if (handled) {
59
+ button = get_uiCurrentTabContent().querySelector('button[id$=_generate]');
60
+ if (button) {
61
+ button.click();
62
+ }
63
+ e.preventDefault();
64
+ }
65
+ })
66
+
67
+ /**
68
+ * checks that a UI element is not in another hidden element or tab content
69
+ */
70
+ function uiElementIsVisible(el) {
71
+ let isVisible = !el.closest('.\\!hidden');
72
+ if ( ! isVisible ) {
73
+ return false;
74
+ }
75
+
76
+ while( isVisible = el.closest('.tabitem')?.style.display !== 'none' ) {
77
+ if ( ! isVisible ) {
78
+ return false;
79
+ } else if ( el.parentElement ) {
80
+ el = el.parentElement
81
+ } else {
82
+ break;
83
+ }
84
+ }
85
+ return isVisible;
86
+ }
style.css ADDED
@@ -0,0 +1,648 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .container {
2
+ max-width: 100%;
3
+ }
4
+
5
+ #txt2img_token_counter {
6
+ height: 0px;
7
+ }
8
+
9
+ #img2img_token_counter {
10
+ height: 0px;
11
+ }
12
+
13
+ #sh{
14
+ min-width: 2em;
15
+ min-height: 2em;
16
+ max-width: 2em;
17
+ max-height: 2em;
18
+ flex-grow: 0;
19
+ padding-left: 0.25em;
20
+ padding-right: 0.25em;
21
+ margin: 0.1em 0;
22
+ opacity: 0%;
23
+ cursor: default;
24
+ }
25
+
26
+ .output-html p {margin: 0 0.5em;}
27
+
28
+ .row > *,
29
+ .row > .gr-form > * {
30
+ min-width: min(120px, 100%);
31
+ flex: 1 1 0%;
32
+ }
33
+
34
+ .performance {
35
+ font-size: 0.85em;
36
+ color: #444;
37
+ }
38
+
39
+ .performance p{
40
+ display: inline-block;
41
+ }
42
+
43
+ .performance .time {
44
+ margin-right: 0;
45
+ }
46
+
47
+ .performance .vram {
48
+ }
49
+
50
+ #txt2img_generate, #img2img_generate {
51
+ min-height: 4.5em;
52
+ }
53
+
54
+ @media screen and (min-width: 2500px) {
55
+ #txt2img_gallery, #img2img_gallery {
56
+ min-height: 768px;
57
+ }
58
+ }
59
+
60
+ #txt2img_gallery img, #img2img_gallery img{
61
+ object-fit: scale-down;
62
+ }
63
+
64
+ .justify-center.overflow-x-scroll {
65
+ justify-content: left;
66
+ }
67
+
68
+ .justify-center.overflow-x-scroll button:first-of-type {
69
+ margin-left: auto;
70
+ }
71
+
72
+ .justify-center.overflow-x-scroll button:last-of-type {
73
+ margin-right: auto;
74
+ }
75
+
76
+ #random_seed, #random_subseed, #reuse_seed, #reuse_subseed, #open_folder{
77
+ min-width: auto;
78
+ flex-grow: 0;
79
+ padding-left: 0.25em;
80
+ padding-right: 0.25em;
81
+ }
82
+
83
+ #hidden_element{
84
+ display: none;
85
+ }
86
+
87
+ #seed_row, #subseed_row{
88
+ gap: 0.5rem;
89
+ }
90
+
91
+ #subseed_show_box{
92
+ min-width: auto;
93
+ flex-grow: 0;
94
+ }
95
+
96
+ #subseed_show_box > div{
97
+ border: 0;
98
+ height: 100%;
99
+ }
100
+
101
+ #subseed_show{
102
+ min-width: auto;
103
+ flex-grow: 0;
104
+ padding: 0;
105
+ }
106
+
107
+ #subseed_show label{
108
+ height: 100%;
109
+ }
110
+
111
+ #roll_col{
112
+ min-width: unset !important;
113
+ flex-grow: 0 !important;
114
+ padding: 0.4em 0;
115
+ }
116
+
117
+ #roll_col > button {
118
+ min-width: 2em;
119
+ min-height: 2em;
120
+ max-width: 2em;
121
+ max-height: 2em;
122
+ flex-grow: 0;
123
+ padding-left: 0.25em;
124
+ padding-right: 0.25em;
125
+ margin: 0.1em 0;
126
+ }
127
+
128
+ #interrogate_col{
129
+ min-width: 0 !important;
130
+ max-width: 8em !important;
131
+ }
132
+ #interrogate, #deepbooru{
133
+ margin: 0em 0.25em 0.9em 0.25em;
134
+ min-width: 8em;
135
+ max-width: 8em;
136
+ }
137
+
138
+ #style_pos_col, #style_neg_col{
139
+ min-width: 8em !important;
140
+ }
141
+
142
+ #txt2img_style_index, #txt2img_style2_index, #img2img_style_index, #img2img_style2_index{
143
+ margin-top: 1em;
144
+ }
145
+
146
+ .gr-form{
147
+ background: transparent;
148
+ }
149
+
150
+ .my-4{
151
+ margin-top: 0;
152
+ margin-bottom: 0;
153
+ }
154
+
155
+ #toprow div{
156
+ border: none;
157
+ gap: 0;
158
+ background: transparent;
159
+ }
160
+
161
+ #resize_mode{
162
+ flex: 1.5;
163
+ }
164
+
165
+ button{
166
+ align-self: stretch !important;
167
+ }
168
+
169
+ .overflow-hidden, .gr-panel{
170
+ overflow: visible !important;
171
+ }
172
+
173
+ #x_type, #y_type{
174
+ max-width: 10em;
175
+ }
176
+
177
+ #txt2img_preview, #img2img_preview, #ti_preview{
178
+ position: absolute;
179
+ width: 320px;
180
+ left: 0;
181
+ right: 0;
182
+ margin-left: auto;
183
+ margin-right: auto;
184
+ margin-top: 34px;
185
+ z-index: 100;
186
+ border: none;
187
+ border-top-left-radius: 0;
188
+ border-top-right-radius: 0;
189
+ }
190
+
191
+ @media screen and (min-width: 768px) {
192
+ #txt2img_preview, #img2img_preview, #ti_preview {
193
+ position: absolute;
194
+ }
195
+ }
196
+
197
+ @media screen and (max-width: 767px) {
198
+ #txt2img_preview, #img2img_preview, #ti_preview {
199
+ position: relative;
200
+ }
201
+ }
202
+
203
+ #txt2img_preview div.left-0.top-0, #img2img_preview div.left-0.top-0, #ti_preview div.left-0.top-0{
204
+ display: none;
205
+ }
206
+
207
+ fieldset span.text-gray-500, .gr-block.gr-box span.text-gray-500, label.block span{
208
+ position: absolute;
209
+ top: -0.6em;
210
+ line-height: 1.2em;
211
+ padding: 0 0.5em;
212
+ margin: 0;
213
+
214
+ background-color: white;
215
+ border-top: 1px solid #eee;
216
+ border-left: 1px solid #eee;
217
+ border-right: 1px solid #eee;
218
+
219
+ z-index: 300;
220
+ }
221
+
222
+ .dark fieldset span.text-gray-500, .dark .gr-block.gr-box span.text-gray-500, .dark label.block span{
223
+ background-color: rgb(31, 41, 55);
224
+ border-top: 1px solid rgb(55 65 81);
225
+ border-left: 1px solid rgb(55 65 81);
226
+ border-right: 1px solid rgb(55 65 81);
227
+ }
228
+
229
+ #settings fieldset span.text-gray-500, #settings .gr-block.gr-box span.text-gray-500, #settings label.block span{
230
+ position: relative;
231
+ border: none;
232
+ margin-right: 8em;
233
+ }
234
+
235
+ .gr-panel div.flex-col div.justify-between label span{
236
+ margin: 0;
237
+ }
238
+
239
+ #settings .gr-panel div.flex-col div.justify-between div{
240
+ position: relative;
241
+ z-index: 200;
242
+ }
243
+
244
+ input[type="range"]{
245
+ margin: 0.5em 0 -0.3em 0;
246
+ }
247
+
248
+ #txt2img_sampling label{
249
+ padding-left: 0.6em;
250
+ padding-right: 0.6em;
251
+ }
252
+
253
+ #mask_bug_info {
254
+ text-align: center;
255
+ display: block;
256
+ margin-top: -0.75em;
257
+ margin-bottom: -0.75em;
258
+ }
259
+
260
+ #txt2img_negative_prompt, #img2img_negative_prompt{
261
+ }
262
+
263
+ /* gradio 3.8 adds opacity to progressbar which makes it blink; disable it here */
264
+ .transition.opacity-20 {
265
+ opacity: 1 !important;
266
+ }
267
+
268
+ /* more gradio's garbage cleanup */
269
+ .min-h-\[4rem\] {
270
+ min-height: unset !important;
271
+ }
272
+
273
+ #txt2img_progressbar, #img2img_progressbar, #ti_progressbar{
274
+ position: absolute;
275
+ z-index: 1000;
276
+ right: 0;
277
+ padding-left: 5px;
278
+ padding-right: 5px;
279
+ display: block;
280
+ }
281
+
282
+ #txt2img_progress_row, #img2img_progress_row{
283
+ margin-bottom: 10px;
284
+ margin-top: -18px;
285
+ }
286
+
287
+ .progressDiv{
288
+ width: 100%;
289
+ height: 20px;
290
+ background: #b4c0cc;
291
+ border-radius: 8px;
292
+ }
293
+
294
+ .dark .progressDiv{
295
+ background: #424c5b;
296
+ }
297
+
298
+ .progressDiv .progress{
299
+ width: 0%;
300
+ height: 20px;
301
+ background: #0060df;
302
+ color: white;
303
+ font-weight: bold;
304
+ line-height: 20px;
305
+ padding: 0 8px 0 0;
306
+ text-align: right;
307
+ border-radius: 8px;
308
+ }
309
+
310
+ #lightboxModal{
311
+ display: none;
312
+ position: fixed;
313
+ z-index: 1001;
314
+ padding-top: 100px;
315
+ left: 0;
316
+ top: 0;
317
+ width: 100%;
318
+ height: 100%;
319
+ overflow: auto;
320
+ background-color: rgba(20, 20, 20, 0.95);
321
+ user-select: none;
322
+ -webkit-user-select: none;
323
+ }
324
+
325
+ .modalControls {
326
+ display: grid;
327
+ grid-template-columns: 32px 32px 32px 1fr 32px;
328
+ grid-template-areas: "zoom tile save space close";
329
+ position: absolute;
330
+ top: 0;
331
+ left: 0;
332
+ right: 0;
333
+ padding: 16px;
334
+ gap: 16px;
335
+ background-color: rgba(0,0,0,0.2);
336
+ }
337
+
338
+ .modalClose {
339
+ grid-area: close;
340
+ }
341
+
342
+ .modalZoom {
343
+ grid-area: zoom;
344
+ }
345
+
346
+ .modalSave {
347
+ grid-area: save;
348
+ }
349
+
350
+ .modalTileImage {
351
+ grid-area: tile;
352
+ }
353
+
354
+ .modalClose,
355
+ .modalZoom,
356
+ .modalTileImage {
357
+ color: white;
358
+ font-size: 35px;
359
+ font-weight: bold;
360
+ cursor: pointer;
361
+ }
362
+
363
+ .modalSave {
364
+ color: white;
365
+ font-size: 28px;
366
+ margin-top: 8px;
367
+ font-weight: bold;
368
+ cursor: pointer;
369
+ }
370
+
371
+ .modalClose:hover,
372
+ .modalClose:focus,
373
+ .modalSave:hover,
374
+ .modalSave:focus,
375
+ .modalZoom:hover,
376
+ .modalZoom:focus {
377
+ color: #999;
378
+ text-decoration: none;
379
+ cursor: pointer;
380
+ }
381
+
382
+ #modalImage {
383
+ display: block;
384
+ margin-left: auto;
385
+ margin-right: auto;
386
+ margin-top: auto;
387
+ width: auto;
388
+ }
389
+
390
+ .modalImageFullscreen {
391
+ object-fit: contain;
392
+ height: 90%;
393
+ }
394
+
395
+ .modalPrev,
396
+ .modalNext {
397
+ cursor: pointer;
398
+ position: absolute;
399
+ top: 50%;
400
+ width: auto;
401
+ padding: 16px;
402
+ margin-top: -50px;
403
+ color: white;
404
+ font-weight: bold;
405
+ font-size: 20px;
406
+ transition: 0.6s ease;
407
+ border-radius: 0 3px 3px 0;
408
+ user-select: none;
409
+ -webkit-user-select: none;
410
+ }
411
+
412
+ .modalNext {
413
+ right: 0;
414
+ border-radius: 3px 0 0 3px;
415
+ }
416
+
417
+ .modalPrev:hover,
418
+ .modalNext:hover {
419
+ background-color: rgba(0, 0, 0, 0.8);
420
+ }
421
+
422
+ #imageARPreview{
423
+ position:absolute;
424
+ top:0px;
425
+ left:0px;
426
+ border:2px solid red;
427
+ background:rgba(255, 0, 0, 0.3);
428
+ z-index: 900;
429
+ pointer-events:none;
430
+ display:none
431
+ }
432
+
433
+ #txt2img_interrupt, #img2img_interrupt{
434
+ position: absolute;
435
+ width: 50%;
436
+ height: 72px;
437
+ background: #b4c0cc;
438
+ border-radius: 0px;
439
+ display: none;
440
+ }
441
+
442
+ #txt2img_skip, #img2img_skip{
443
+ position: absolute;
444
+ width: 50%;
445
+ right: 0px;
446
+ height: 72px;
447
+ background: #b4c0cc;
448
+ border-radius: 0px;
449
+ display: none;
450
+ }
451
+
452
+ .red {
453
+ color: red;
454
+ }
455
+
456
+ .gallery-item {
457
+ --tw-bg-opacity: 0 !important;
458
+ }
459
+
460
+ #context-menu{
461
+ z-index:9999;
462
+ position:absolute;
463
+ display:block;
464
+ padding:0px 0;
465
+ border:2px solid #a55000;
466
+ border-radius:8px;
467
+ box-shadow:1px 1px 2px #CE6400;
468
+ width: 200px;
469
+ }
470
+
471
+ .context-menu-items{
472
+ list-style: none;
473
+ margin: 0;
474
+ padding: 0;
475
+ }
476
+
477
+ .context-menu-items a{
478
+ display:block;
479
+ padding:5px;
480
+ cursor:pointer;
481
+ }
482
+
483
+ .context-menu-items a:hover{
484
+ background: #a55000;
485
+ }
486
+
487
+ #quicksettings {
488
+ gap: 0.4em;
489
+ }
490
+
491
+ #quicksettings > div{
492
+ border: none;
493
+ background: none;
494
+ flex: unset;
495
+ gap: 0.5em;
496
+ }
497
+
498
+ #quicksettings > div > div{
499
+ max-width: 32em;
500
+ min-width: 24em;
501
+ padding: 0;
502
+ }
503
+
504
+ #refresh_sd_model_checkpoint, #refresh_sd_vae, #refresh_sd_hypernetwork, #refresh_train_hypernetwork_name, #refresh_train_embedding_name, #refresh_localization{
505
+ max-width: 2.5em;
506
+ min-width: 2.5em;
507
+ height: 2.4em;
508
+ }
509
+
510
+
511
+ canvas[key="mask"] {
512
+ z-index: 12 !important;
513
+ filter: invert();
514
+ mix-blend-mode: multiply;
515
+ pointer-events: none;
516
+ }
517
+
518
+
519
+ /* gradio 3.4.1 stuff for editable scrollbar values */
520
+ .gr-box > div > div > input.gr-text-input{
521
+ position: absolute;
522
+ right: 0.5em;
523
+ top: -0.6em;
524
+ z-index: 200;
525
+ width: 8em;
526
+ }
527
+ #quicksettings .gr-box > div > div > input.gr-text-input {
528
+ top: -1.12em;
529
+ }
530
+
531
+ .row.gr-compact{
532
+ overflow: visible;
533
+ }
534
+
535
+ #img2img_image, #img2img_image > .h-60, #img2img_image > .h-60 > div, #img2img_image > .h-60 > div > img,
536
+ img2maskimg, #img2maskimg > .h-60, #img2maskimg > .h-60 > div, #img2maskimg > .h-60 > div > img
537
+ {
538
+ height: 480px !important;
539
+ max-height: 480px !important;
540
+ min-height: 480px !important;
541
+ }
542
+
543
+ /* Extensions */
544
+
545
+ #tab_extensions table{
546
+ border-collapse: collapse;
547
+ }
548
+
549
+ #tab_extensions table td, #tab_extensions table th{
550
+ border: 1px solid #ccc;
551
+ padding: 0.25em 0.5em;
552
+ }
553
+
554
+ #tab_extensions table input[type="checkbox"]{
555
+ margin-right: 0.5em;
556
+ }
557
+
558
+ #tab_extensions button{
559
+ max-width: 16em;
560
+ }
561
+
562
+ #tab_extensions input[disabled="disabled"]{
563
+ opacity: 0.5;
564
+ }
565
+
566
+ .extension-tag{
567
+ font-weight: bold;
568
+ font-size: 95%;
569
+ }
570
+
571
+ /* The following handles localization for right-to-left (RTL) languages like Arabic.
572
+ The rtl media type will only be activated by the logic in javascript/localization.js.
573
+ If you change anything above, you need to make sure it is RTL compliant by just running
574
+ your changes through converters like https://cssjanus.github.io/ or https://rtlcss.com/.
575
+ Then, you will need to add the RTL counterpart only if needed in the rtl section below.*/
576
+ @media rtl {
577
+ /* this part was added manually */
578
+ :host {
579
+ direction: rtl;
580
+ }
581
+ select, .file-preview, .gr-text-input, .output-html:has(.performance), #ti_progress {
582
+ direction: ltr;
583
+ }
584
+ #script_list > label > select,
585
+ #x_type > label > select,
586
+ #y_type > label > select {
587
+ direction: rtl;
588
+ }
589
+ .gr-radio, .gr-checkbox{
590
+ margin-left: 0.25em;
591
+ }
592
+
593
+ /* automatically generated with few manual modifications */
594
+ .performance .time {
595
+ margin-right: unset;
596
+ margin-left: 0;
597
+ }
598
+ .justify-center.overflow-x-scroll {
599
+ justify-content: right;
600
+ }
601
+ .justify-center.overflow-x-scroll button:first-of-type {
602
+ margin-left: unset;
603
+ margin-right: auto;
604
+ }
605
+ .justify-center.overflow-x-scroll button:last-of-type {
606
+ margin-right: unset;
607
+ margin-left: auto;
608
+ }
609
+ #settings fieldset span.text-gray-500, #settings .gr-block.gr-box span.text-gray-500, #settings label.block span{
610
+ margin-right: unset;
611
+ margin-left: 8em;
612
+ }
613
+ #txt2img_progressbar, #img2img_progressbar, #ti_progressbar{
614
+ right: unset;
615
+ left: 0;
616
+ }
617
+ .progressDiv .progress{
618
+ padding: 0 0 0 8px;
619
+ text-align: left;
620
+ }
621
+ #lightboxModal{
622
+ left: unset;
623
+ right: 0;
624
+ }
625
+ .modalPrev, .modalNext{
626
+ border-radius: 3px 0 0 3px;
627
+ }
628
+ .modalNext {
629
+ right: unset;
630
+ left: 0;
631
+ border-radius: 0 3px 3px 0;
632
+ }
633
+ #imageARPreview{
634
+ left:unset;
635
+ right:0px;
636
+ }
637
+ #txt2img_skip, #img2img_skip{
638
+ right: unset;
639
+ left: 0px;
640
+ }
641
+ #context-menu{
642
+ box-shadow:-1px 1px 2px #CE6400;
643
+ }
644
+ .gr-box > div > div > input.gr-text-input{
645
+ right: unset;
646
+ left: 0.5em;
647
+ }
648
+ }
txt2img_Screenshot.png ADDED

Git LFS Details

  • SHA256: 215f0a0684e00a3b96af13bc5e905ab7f50ff50d045c8077c06fd4cab7f49f7e
  • Pointer size: 131 Bytes
  • Size of remote file: 337 kB
ui-config.json ADDED
@@ -0,0 +1,371 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "txt2img/Prompt/visible": true,
3
+ "txt2img/Prompt/value": "masterpiece, best quality, ",
4
+ "txt2img/Negative prompt/visible": true,
5
+ "txt2img/Negative prompt/value": "lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username",
6
+ "txt2img/Style 1/value": "None",
7
+ "txt2img/Style 2/value": "None",
8
+ "txt2img/Sampling Steps/visible": true,
9
+ "txt2img/Sampling Steps/value": 28,
10
+ "txt2img/Sampling Steps/minimum": 1,
11
+ "txt2img/Sampling Steps/maximum": 150,
12
+ "txt2img/Sampling Steps/step": 1,
13
+ "txt2img/Sampling method/visible": true,
14
+ "txt2img/Sampling method/value": "Euler a",
15
+ "txt2img/Width/visible": true,
16
+ "txt2img/Width/value": 512,
17
+ "txt2img/Width/minimum": 64,
18
+ "txt2img/Width/maximum": 2048,
19
+ "txt2img/Width/step": 64,
20
+ "txt2img/Height/visible": true,
21
+ "txt2img/Height/value": 768,
22
+ "txt2img/Height/minimum": 64,
23
+ "txt2img/Height/maximum": 2048,
24
+ "txt2img/Height/step": 64,
25
+ "txt2img/Restore faces/visible": true,
26
+ "txt2img/Restore faces/value": false,
27
+ "txt2img/Tiling/visible": true,
28
+ "txt2img/Tiling/value": false,
29
+ "txt2img/Highres. fix/visible": true,
30
+ "txt2img/Highres. fix/value": false,
31
+ "txt2img/Firstpass width/visible": true,
32
+ "txt2img/Firstpass width/value": 0,
33
+ "txt2img/Firstpass width/minimum": 0,
34
+ "txt2img/Firstpass width/maximum": 1024,
35
+ "txt2img/Firstpass width/step": 64,
36
+ "txt2img/Firstpass height/visible": true,
37
+ "txt2img/Firstpass height/value": 0,
38
+ "txt2img/Firstpass height/minimum": 0,
39
+ "txt2img/Firstpass height/maximum": 1024,
40
+ "txt2img/Firstpass height/step": 64,
41
+ "txt2img/Denoising strength/visible": true,
42
+ "txt2img/Denoising strength/value": 0.7,
43
+ "txt2img/Denoising strength/minimum": 0.0,
44
+ "txt2img/Denoising strength/maximum": 1.0,
45
+ "txt2img/Denoising strength/step": 0.01,
46
+ "txt2img/Batch count/visible": true,
47
+ "txt2img/Batch count/value": 1,
48
+ "txt2img/Batch count/minimum": 1,
49
+ "txt2img/Batch count/maximum": 100,
50
+ "txt2img/Batch count/step": 1,
51
+ "txt2img/Batch size/visible": true,
52
+ "txt2img/Batch size/value": 1,
53
+ "txt2img/Batch size/minimum": 1,
54
+ "txt2img/Batch size/maximum": 8,
55
+ "txt2img/Batch size/step": 1,
56
+ "txt2img/CFG Scale/visible": true,
57
+ "txt2img/CFG Scale/value": 8.0,
58
+ "txt2img/CFG Scale/minimum": 1.0,
59
+ "txt2img/CFG Scale/maximum": 30.0,
60
+ "txt2img/CFG Scale/step": 0.5,
61
+ "txt2img/Seed/visible": true,
62
+ "txt2img/Seed/value": -1.0,
63
+ "txt2img/Extra/visible": true,
64
+ "txt2img/Extra/value": false,
65
+ "txt2img/Variation seed/visible": true,
66
+ "txt2img/Variation seed/value": -1.0,
67
+ "txt2img/Variation strength/visible": true,
68
+ "txt2img/Variation strength/value": 0.0,
69
+ "txt2img/Variation strength/minimum": 0,
70
+ "txt2img/Variation strength/maximum": 1,
71
+ "txt2img/Variation strength/step": 0.01,
72
+ "txt2img/Resize seed from width/visible": true,
73
+ "txt2img/Resize seed from width/value": 0,
74
+ "txt2img/Resize seed from width/minimum": 0,
75
+ "txt2img/Resize seed from width/maximum": 2048,
76
+ "txt2img/Resize seed from width/step": 64,
77
+ "txt2img/Resize seed from height/visible": true,
78
+ "txt2img/Resize seed from height/value": 0,
79
+ "txt2img/Resize seed from height/minimum": 0,
80
+ "txt2img/Resize seed from height/maximum": 2048,
81
+ "txt2img/Resize seed from height/step": 64,
82
+ "customscript/prompt_matrix.py/txt2img/Put variable parts at start of prompt/value": false,
83
+ "customscript/prompts_from_file.py/txt2img/Show Textbox/value": false,
84
+ "customscript/xy_grid.py/txt2img/X values/value": "",
85
+ "customscript/xy_grid.py/txt2img/Y values/value": "",
86
+ "customscript/xy_grid.py/txt2img/Draw legend/value": true,
87
+ "customscript/xy_grid.py/txt2img/Include Separate Images/value": false,
88
+ "customscript/xy_grid.py/txt2img/Keep -1 for seeds/value": false,
89
+ "txt2img/Make Zip when Save?/visible": true,
90
+ "txt2img/Make Zip when Save?/value": false,
91
+ "img2img/Prompt/visible": true,
92
+ "img2img/Prompt/value": "",
93
+ "img2img/Negative prompt/visible": true,
94
+ "img2img/Negative prompt/value": "",
95
+ "img2img/Style 1/value": "None",
96
+ "img2img/Style 2/value": "None",
97
+ "img2img/Mask blur/visible": true,
98
+ "img2img/Mask blur/value": 4,
99
+ "img2img/Mask blur/minimum": 0,
100
+ "img2img/Mask blur/maximum": 64,
101
+ "img2img/Mask blur/step": 1,
102
+ "img2img/Mask mode/visible": true,
103
+ "img2img/Mask mode/value": "Draw mask",
104
+ "img2img/Masking mode/visible": true,
105
+ "img2img/Masking mode/value": "Inpaint masked",
106
+ "img2img/Masked content/visible": true,
107
+ "img2img/Masked content/value": "original",
108
+ "img2img/Inpaint at full resolution/visible": true,
109
+ "img2img/Inpaint at full resolution/value": false,
110
+ "img2img/Inpaint at full resolution padding, pixels/visible": true,
111
+ "img2img/Inpaint at full resolution padding, pixels/value": 32,
112
+ "img2img/Inpaint at full resolution padding, pixels/minimum": 0,
113
+ "img2img/Inpaint at full resolution padding, pixels/maximum": 256,
114
+ "img2img/Inpaint at full resolution padding, pixels/step": 4,
115
+ "img2img/Input directory/visible": true,
116
+ "img2img/Input directory/value": "",
117
+ "img2img/Output directory/visible": true,
118
+ "img2img/Output directory/value": "",
119
+ "img2img/Resize mode/visible": true,
120
+ "img2img/Resize mode/value": "Just resize",
121
+ "img2img/Sampling Steps/visible": true,
122
+ "img2img/Sampling Steps/value": 20,
123
+ "img2img/Sampling Steps/minimum": 1,
124
+ "img2img/Sampling Steps/maximum": 150,
125
+ "img2img/Sampling Steps/step": 1,
126
+ "img2img/Sampling method/visible": true,
127
+ "img2img/Sampling method/value": "Euler a",
128
+ "img2img/Width/visible": true,
129
+ "img2img/Width/value": 512,
130
+ "img2img/Width/minimum": 64,
131
+ "img2img/Width/maximum": 2048,
132
+ "img2img/Width/step": 64,
133
+ "img2img/Height/visible": true,
134
+ "img2img/Height/value": 512,
135
+ "img2img/Height/minimum": 64,
136
+ "img2img/Height/maximum": 2048,
137
+ "img2img/Height/step": 64,
138
+ "img2img/Restore faces/visible": true,
139
+ "img2img/Restore faces/value": false,
140
+ "img2img/Tiling/visible": true,
141
+ "img2img/Tiling/value": false,
142
+ "img2img/Batch count/visible": true,
143
+ "img2img/Batch count/value": 1,
144
+ "img2img/Batch count/minimum": 1,
145
+ "img2img/Batch count/maximum": 100,
146
+ "img2img/Batch count/step": 1,
147
+ "img2img/Batch size/visible": true,
148
+ "img2img/Batch size/value": 1,
149
+ "img2img/Batch size/minimum": 1,
150
+ "img2img/Batch size/maximum": 8,
151
+ "img2img/Batch size/step": 1,
152
+ "img2img/CFG Scale/visible": true,
153
+ "img2img/CFG Scale/value": 7.0,
154
+ "img2img/CFG Scale/minimum": 1.0,
155
+ "img2img/CFG Scale/maximum": 30.0,
156
+ "img2img/CFG Scale/step": 0.5,
157
+ "img2img/Denoising strength/visible": true,
158
+ "img2img/Denoising strength/value": 0.75,
159
+ "img2img/Denoising strength/minimum": 0.0,
160
+ "img2img/Denoising strength/maximum": 1.0,
161
+ "img2img/Denoising strength/step": 0.01,
162
+ "img2img/Seed/visible": true,
163
+ "img2img/Seed/value": -1.0,
164
+ "img2img/Extra/visible": true,
165
+ "img2img/Extra/value": false,
166
+ "img2img/Variation seed/visible": true,
167
+ "img2img/Variation seed/value": -1.0,
168
+ "img2img/Variation strength/visible": true,
169
+ "img2img/Variation strength/value": 0.0,
170
+ "img2img/Variation strength/minimum": 0,
171
+ "img2img/Variation strength/maximum": 1,
172
+ "img2img/Variation strength/step": 0.01,
173
+ "img2img/Resize seed from width/visible": true,
174
+ "img2img/Resize seed from width/value": 0,
175
+ "img2img/Resize seed from width/minimum": 0,
176
+ "img2img/Resize seed from width/maximum": 2048,
177
+ "img2img/Resize seed from width/step": 64,
178
+ "img2img/Resize seed from height/visible": true,
179
+ "img2img/Resize seed from height/value": 0,
180
+ "img2img/Resize seed from height/minimum": 0,
181
+ "img2img/Resize seed from height/maximum": 2048,
182
+ "img2img/Resize seed from height/step": 64,
183
+ "customscript/img2imgalt.py/img2img/Override `Sampling method` to Euler?(this method is built for it)/value": true,
184
+ "customscript/img2imgalt.py/img2img/Override `prompt` to the same value as `original prompt`?(and `negative prompt`)/value": true,
185
+ "customscript/img2imgalt.py/img2img/Original prompt/value": "",
186
+ "customscript/img2imgalt.py/img2img/Original negative prompt/value": "",
187
+ "customscript/img2imgalt.py/img2img/Override `Sampling Steps` to the same value as `Decode steps`?/value": true,
188
+ "customscript/img2imgalt.py/img2img/Decode steps/value": 50,
189
+ "customscript/img2imgalt.py/img2img/Decode steps/minimum": 1,
190
+ "customscript/img2imgalt.py/img2img/Decode steps/maximum": 150,
191
+ "customscript/img2imgalt.py/img2img/Decode steps/step": 1,
192
+ "customscript/img2imgalt.py/img2img/Override `Denoising strength` to 1?/value": true,
193
+ "customscript/img2imgalt.py/img2img/Decode CFG scale/value": 1.0,
194
+ "customscript/img2imgalt.py/img2img/Decode CFG scale/minimum": 0.0,
195
+ "customscript/img2imgalt.py/img2img/Decode CFG scale/maximum": 15.0,
196
+ "customscript/img2imgalt.py/img2img/Decode CFG scale/step": 0.1,
197
+ "customscript/img2imgalt.py/img2img/Randomness/value": 0.0,
198
+ "customscript/img2imgalt.py/img2img/Randomness/minimum": 0.0,
199
+ "customscript/img2imgalt.py/img2img/Randomness/maximum": 1.0,
200
+ "customscript/img2imgalt.py/img2img/Randomness/step": 0.01,
201
+ "customscript/img2imgalt.py/img2img/Sigma adjustment for finding noise for image/value": false,
202
+ "customscript/loopback.py/img2img/Loops/value": 4,
203
+ "customscript/loopback.py/img2img/Loops/minimum": 1,
204
+ "customscript/loopback.py/img2img/Loops/maximum": 32,
205
+ "customscript/loopback.py/img2img/Loops/step": 1,
206
+ "customscript/loopback.py/img2img/Denoising strength change factor/value": 1,
207
+ "customscript/loopback.py/img2img/Denoising strength change factor/minimum": 0.9,
208
+ "customscript/loopback.py/img2img/Denoising strength change factor/maximum": 1.1,
209
+ "customscript/loopback.py/img2img/Denoising strength change factor/step": 0.01,
210
+ "customscript/outpainting_mk_2.py/img2img/Pixels to expand/value": 128,
211
+ "customscript/outpainting_mk_2.py/img2img/Pixels to expand/minimum": 8,
212
+ "customscript/outpainting_mk_2.py/img2img/Pixels to expand/maximum": 256,
213
+ "customscript/outpainting_mk_2.py/img2img/Pixels to expand/step": 8,
214
+ "customscript/outpainting_mk_2.py/img2img/Mask blur/value": 8,
215
+ "customscript/outpainting_mk_2.py/img2img/Mask blur/minimum": 0,
216
+ "customscript/outpainting_mk_2.py/img2img/Mask blur/maximum": 64,
217
+ "customscript/outpainting_mk_2.py/img2img/Mask blur/step": 1,
218
+ "customscript/outpainting_mk_2.py/img2img/Fall-off exponent (lower=higher detail)/value": 1.0,
219
+ "customscript/outpainting_mk_2.py/img2img/Fall-off exponent (lower=higher detail)/minimum": 0.0,
220
+ "customscript/outpainting_mk_2.py/img2img/Fall-off exponent (lower=higher detail)/maximum": 4.0,
221
+ "customscript/outpainting_mk_2.py/img2img/Fall-off exponent (lower=higher detail)/step": 0.01,
222
+ "customscript/outpainting_mk_2.py/img2img/Color variation/value": 0.05,
223
+ "customscript/outpainting_mk_2.py/img2img/Color variation/minimum": 0.0,
224
+ "customscript/outpainting_mk_2.py/img2img/Color variation/maximum": 1.0,
225
+ "customscript/outpainting_mk_2.py/img2img/Color variation/step": 0.01,
226
+ "customscript/poor_mans_outpainting.py/img2img/Pixels to expand/value": 128,
227
+ "customscript/poor_mans_outpainting.py/img2img/Pixels to expand/minimum": 8,
228
+ "customscript/poor_mans_outpainting.py/img2img/Pixels to expand/maximum": 256,
229
+ "customscript/poor_mans_outpainting.py/img2img/Pixels to expand/step": 8,
230
+ "customscript/poor_mans_outpainting.py/img2img/Mask blur/value": 4,
231
+ "customscript/poor_mans_outpainting.py/img2img/Mask blur/minimum": 0,
232
+ "customscript/poor_mans_outpainting.py/img2img/Mask blur/maximum": 64,
233
+ "customscript/poor_mans_outpainting.py/img2img/Mask blur/step": 1,
234
+ "customscript/poor_mans_outpainting.py/img2img/Masked content/value": "fill",
235
+ "customscript/prompt_matrix.py/img2img/Put variable parts at start of prompt/value": false,
236
+ "customscript/prompts_from_file.py/img2img/Show Textbox/value": false,
237
+ "customscript/sd_upscale.py/img2img/Tile overlap/value": 64,
238
+ "customscript/sd_upscale.py/img2img/Tile overlap/minimum": 0,
239
+ "customscript/sd_upscale.py/img2img/Tile overlap/maximum": 256,
240
+ "customscript/sd_upscale.py/img2img/Tile overlap/step": 16,
241
+ "customscript/sd_upscale.py/img2img/Upscaler/value": "None",
242
+ "customscript/xy_grid.py/img2img/X values/value": "",
243
+ "customscript/xy_grid.py/img2img/Y values/value": "",
244
+ "customscript/xy_grid.py/img2img/Draw legend/value": true,
245
+ "customscript/xy_grid.py/img2img/Include Separate Images/value": false,
246
+ "customscript/xy_grid.py/img2img/Keep -1 for seeds/value": false,
247
+ "img2img/Make Zip when Save?/visible": true,
248
+ "img2img/Make Zip when Save?/value": false,
249
+ "extras/Input directory/visible": true,
250
+ "extras/Input directory/value": "",
251
+ "extras/Output directory/visible": true,
252
+ "extras/Output directory/value": "",
253
+ "extras/Show result images/visible": true,
254
+ "extras/Show result images/value": true,
255
+ "extras/Resize/visible": true,
256
+ "extras/Resize/value": 2,
257
+ "extras/Resize/minimum": 1.0,
258
+ "extras/Resize/maximum": 4.0,
259
+ "extras/Resize/step": 0.05,
260
+ "extras/Width/visible": true,
261
+ "extras/Width/value": 512,
262
+ "extras/Height/visible": true,
263
+ "extras/Height/value": 512,
264
+ "extras/Crop to fit/visible": true,
265
+ "extras/Crop to fit/value": true,
266
+ "extras/Upscaler 1/visible": true,
267
+ "extras/Upscaler 1/value": "None",
268
+ "extras/Upscaler 2/visible": true,
269
+ "extras/Upscaler 2/value": "None",
270
+ "extras/Upscaler 2 visibility/visible": true,
271
+ "extras/Upscaler 2 visibility/value": 1,
272
+ "extras/Upscaler 2 visibility/minimum": 0.0,
273
+ "extras/Upscaler 2 visibility/maximum": 1.0,
274
+ "extras/Upscaler 2 visibility/step": 0.001,
275
+ "extras/GFPGAN visibility/visible": true,
276
+ "extras/GFPGAN visibility/value": 0,
277
+ "extras/GFPGAN visibility/minimum": 0.0,
278
+ "extras/GFPGAN visibility/maximum": 1.0,
279
+ "extras/GFPGAN visibility/step": 0.001,
280
+ "extras/CodeFormer visibility/visible": true,
281
+ "extras/CodeFormer visibility/value": 0,
282
+ "extras/CodeFormer visibility/minimum": 0.0,
283
+ "extras/CodeFormer visibility/maximum": 1.0,
284
+ "extras/CodeFormer visibility/step": 0.001,
285
+ "extras/CodeFormer weight (0 = maximum effect, 1 = minimum effect)/visible": true,
286
+ "extras/CodeFormer weight (0 = maximum effect, 1 = minimum effect)/value": 0,
287
+ "extras/CodeFormer weight (0 = maximum effect, 1 = minimum effect)/minimum": 0.0,
288
+ "extras/CodeFormer weight (0 = maximum effect, 1 = minimum effect)/maximum": 1.0,
289
+ "extras/CodeFormer weight (0 = maximum effect, 1 = minimum effect)/step": 0.001,
290
+ "modelmerger/Custom Name (Optional)/visible": true,
291
+ "modelmerger/Custom Name (Optional)/value": "",
292
+ "modelmerger/Multiplier (M) - set to 0 to get model A/visible": true,
293
+ "modelmerger/Multiplier (M) - set to 0 to get model A/value": 0.3,
294
+ "modelmerger/Multiplier (M) - set to 0 to get model A/minimum": 0.0,
295
+ "modelmerger/Multiplier (M) - set to 0 to get model A/maximum": 1.0,
296
+ "modelmerger/Multiplier (M) - set to 0 to get model A/step": 0.05,
297
+ "modelmerger/Interpolation Method/visible": true,
298
+ "modelmerger/Interpolation Method/value": "Weighted sum",
299
+ "modelmerger/Save as float16/visible": true,
300
+ "modelmerger/Save as float16/value": false,
301
+ "txt2img/Style 1/visible": true,
302
+ "txt2img/Style 2/visible": true,
303
+ "txt2img/Script/value": "None",
304
+ "txt2img/Script/visible": true,
305
+ "img2img/Style 1/visible": true,
306
+ "img2img/Style 2/visible": true,
307
+ "img2img/Script/value": "None",
308
+ "img2img/Script/visible": true,
309
+ "customscript/prompt_matrix.py/txt2img/Put variable parts at start of prompt/visible": true,
310
+ "customscript/prompt_matrix.py/txt2img/Use different seed for each picture/visible": true,
311
+ "customscript/prompt_matrix.py/txt2img/Use different seed for each picture/value": false,
312
+ "customscript/prompts_from_file.py/txt2img/Iterate seed every line/visible": true,
313
+ "customscript/prompts_from_file.py/txt2img/Iterate seed every line/value": false,
314
+ "customscript/prompts_from_file.py/txt2img/Use same random seed for all lines/visible": true,
315
+ "customscript/prompts_from_file.py/txt2img/Use same random seed for all lines/value": false,
316
+ "customscript/prompts_from_file.py/txt2img/List of prompt inputs/visible": true,
317
+ "customscript/prompts_from_file.py/txt2img/List of prompt inputs/value": "",
318
+ "customscript/xy_grid.py/txt2img/X values/visible": true,
319
+ "customscript/xy_grid.py/txt2img/Y values/visible": true,
320
+ "customscript/xy_grid.py/txt2img/Draw legend/visible": true,
321
+ "customscript/xy_grid.py/txt2img/Include Separate Images/visible": true,
322
+ "customscript/xy_grid.py/txt2img/Keep -1 for seeds/visible": true,
323
+ "img2img/Mask transparency/value": 0,
324
+ "img2img/Mask transparency/minimum": 0,
325
+ "img2img/Mask transparency/maximum": 100,
326
+ "img2img/Mask transparency/step": 1,
327
+ "customscript/img2imgalt.py/img2img/Override `Sampling method` to Euler?(this method is built for it)/visible": true,
328
+ "customscript/img2imgalt.py/img2img/Override `prompt` to the same value as `original prompt`?(and `negative prompt`)/visible": true,
329
+ "customscript/img2imgalt.py/img2img/Original prompt/visible": true,
330
+ "customscript/img2imgalt.py/img2img/Original negative prompt/visible": true,
331
+ "customscript/img2imgalt.py/img2img/Override `Sampling Steps` to the same value as `Decode steps`?/visible": true,
332
+ "customscript/img2imgalt.py/img2img/Decode steps/visible": true,
333
+ "customscript/img2imgalt.py/img2img/Override `Denoising strength` to 1?/visible": true,
334
+ "customscript/img2imgalt.py/img2img/Decode CFG scale/visible": true,
335
+ "customscript/img2imgalt.py/img2img/Randomness/visible": true,
336
+ "customscript/img2imgalt.py/img2img/Sigma adjustment for finding noise for image/visible": true,
337
+ "customscript/loopback.py/img2img/Loops/visible": true,
338
+ "customscript/loopback.py/img2img/Denoising strength change factor/visible": true,
339
+ "customscript/outpainting_mk_2.py/img2img/Pixels to expand/visible": true,
340
+ "customscript/outpainting_mk_2.py/img2img/Mask blur/visible": true,
341
+ "customscript/outpainting_mk_2.py/img2img/Fall-off exponent (lower=higher detail)/visible": true,
342
+ "customscript/outpainting_mk_2.py/img2img/Color variation/visible": true,
343
+ "customscript/poor_mans_outpainting.py/img2img/Pixels to expand/visible": true,
344
+ "customscript/poor_mans_outpainting.py/img2img/Mask blur/visible": true,
345
+ "customscript/poor_mans_outpainting.py/img2img/Masked content/visible": true,
346
+ "customscript/prompt_matrix.py/img2img/Put variable parts at start of prompt/visible": true,
347
+ "customscript/prompt_matrix.py/img2img/Use different seed for each picture/visible": true,
348
+ "customscript/prompt_matrix.py/img2img/Use different seed for each picture/value": false,
349
+ "customscript/prompts_from_file.py/img2img/Iterate seed every line/visible": true,
350
+ "customscript/prompts_from_file.py/img2img/Iterate seed every line/value": false,
351
+ "customscript/prompts_from_file.py/img2img/Use same random seed for all lines/visible": true,
352
+ "customscript/prompts_from_file.py/img2img/Use same random seed for all lines/value": false,
353
+ "customscript/prompts_from_file.py/img2img/List of prompt inputs/visible": true,
354
+ "customscript/prompts_from_file.py/img2img/List of prompt inputs/value": "",
355
+ "customscript/sd_upscale.py/img2img/Tile overlap/visible": true,
356
+ "customscript/sd_upscale.py/img2img/Scale Factor/visible": true,
357
+ "customscript/sd_upscale.py/img2img/Scale Factor/value": 2,
358
+ "customscript/sd_upscale.py/img2img/Scale Factor/minimum": 1,
359
+ "customscript/sd_upscale.py/img2img/Scale Factor/maximum": 4,
360
+ "customscript/sd_upscale.py/img2img/Scale Factor/step": 1,
361
+ "customscript/sd_upscale.py/img2img/Upscaler/visible": true,
362
+ "customscript/xy_grid.py/img2img/X values/visible": true,
363
+ "customscript/xy_grid.py/img2img/Y values/visible": true,
364
+ "customscript/xy_grid.py/img2img/Draw legend/visible": true,
365
+ "customscript/xy_grid.py/img2img/Include Separate Images/visible": true,
366
+ "customscript/xy_grid.py/img2img/Keep -1 for seeds/visible": true,
367
+ "extras/Upscale Before Restoring Faces/visible": true,
368
+ "extras/Upscale Before Restoring Faces/value": false,
369
+ "modelmerger/Checkpoint format/visible": true,
370
+ "modelmerger/Checkpoint format/value": "ckpt"
371
+ }
v1-inference.yaml ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ model:
2
+ base_learning_rate: 1.0e-04
3
+ target: ldm.models.diffusion.ddpm.LatentDiffusion
4
+ params:
5
+ linear_start: 0.00085
6
+ linear_end: 0.0120
7
+ num_timesteps_cond: 1
8
+ log_every_t: 200
9
+ timesteps: 1000
10
+ first_stage_key: "jpg"
11
+ cond_stage_key: "txt"
12
+ image_size: 64
13
+ channels: 4
14
+ cond_stage_trainable: false # Note: different from the one we trained before
15
+ conditioning_key: crossattn
16
+ monitor: val/loss_simple_ema
17
+ scale_factor: 0.18215
18
+ use_ema: False
19
+
20
+ scheduler_config: # 10000 warmup steps
21
+ target: ldm.lr_scheduler.LambdaLinearScheduler
22
+ params:
23
+ warm_up_steps: [ 10000 ]
24
+ cycle_lengths: [ 10000000000000 ] # incredibly large number to prevent corner cases
25
+ f_start: [ 1.e-6 ]
26
+ f_max: [ 1. ]
27
+ f_min: [ 1. ]
28
+
29
+ unet_config:
30
+ target: ldm.modules.diffusionmodules.openaimodel.UNetModel
31
+ params:
32
+ image_size: 32 # unused
33
+ in_channels: 4
34
+ out_channels: 4
35
+ model_channels: 320
36
+ attention_resolutions: [ 4, 2, 1 ]
37
+ num_res_blocks: 2
38
+ channel_mult: [ 1, 2, 4, 4 ]
39
+ num_heads: 8
40
+ use_spatial_transformer: True
41
+ transformer_depth: 1
42
+ context_dim: 768
43
+ use_checkpoint: True
44
+ legacy: False
45
+
46
+ first_stage_config:
47
+ target: ldm.models.autoencoder.AutoencoderKL
48
+ params:
49
+ embed_dim: 4
50
+ monitor: val/rec_loss
51
+ ddconfig:
52
+ double_z: true
53
+ z_channels: 4
54
+ resolution: 256
55
+ in_channels: 3
56
+ out_ch: 3
57
+ ch: 128
58
+ ch_mult:
59
+ - 1
60
+ - 2
61
+ - 4
62
+ - 4
63
+ num_res_blocks: 2
64
+ attn_resolutions: []
65
+ dropout: 0.0
66
+ lossconfig:
67
+ target: torch.nn.Identity
68
+
69
+ cond_stage_config:
70
+ target: ldm.modules.encoders.modules.FrozenCLIPEmbedder
webui-macos-env.sh ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ ####################################################################
3
+ # macOS defaults #
4
+ # Please modify webui-user.sh to change these instead of this file #
5
+ ####################################################################
6
+
7
+ if [[ -x "$(command -v python3.10)" ]]
8
+ then
9
+ python_cmd="python3.10"
10
+ fi
11
+
12
+ export install_dir="$HOME"
13
+ export COMMANDLINE_ARGS="--skip-torch-cuda-test --no-half --use-cpu interrogate"
14
+ export TORCH_COMMAND="pip install torch==1.12.1 torchvision==0.13.1"
15
+ export K_DIFFUSION_REPO="https://github.com/brkirch/k-diffusion.git"
16
+ export K_DIFFUSION_COMMIT_HASH="51c9778f269cedb55a4d88c79c0246d35bdadb71"
17
+ export PYTORCH_ENABLE_MPS_FALLBACK=1
18
+
19
+ ####################################################################
webui-user.bat ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ @echo off
2
+
3
+ set PYTHON=
4
+ set GIT=
5
+ set VENV_DIR=
6
+ set COMMANDLINE_ARGS=
7
+
8
+ call webui.bat
webui-user.sh ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ #########################################################
3
+ # Uncomment and change the variables below to your need:#
4
+ #########################################################
5
+
6
+ # Install directory without trailing slash
7
+ #install_dir="/home/$(whoami)"
8
+
9
+ # Name of the subdirectory
10
+ #clone_dir="stable-diffusion-webui"
11
+
12
+ # Commandline arguments for webui.py, for example: export COMMANDLINE_ARGS="--medvram --opt-split-attention"
13
+ #export COMMANDLINE_ARGS=""
14
+
15
+ # python3 executable
16
+ #python_cmd="python3"
17
+
18
+ # git executable
19
+ #export GIT="git"
20
+
21
+ # python3 venv without trailing slash (defaults to ${install_dir}/${clone_dir}/venv)
22
+ #venv_dir="venv"
23
+
24
+ # script to launch to start the app
25
+ #export LAUNCH_SCRIPT="launch.py"
26
+
27
+ # install command for torch
28
+ #export TORCH_COMMAND="pip install torch==1.12.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113"
29
+
30
+ # Requirements file to use for stable-diffusion-webui
31
+ #export REQS_FILE="requirements_versions.txt"
32
+
33
+ # Fixed git repos
34
+ #export K_DIFFUSION_PACKAGE=""
35
+ #export GFPGAN_PACKAGE=""
36
+
37
+ # Fixed git commits
38
+ #export STABLE_DIFFUSION_COMMIT_HASH=""
39
+ #export TAMING_TRANSFORMERS_COMMIT_HASH=""
40
+ #export CODEFORMER_COMMIT_HASH=""
41
+ #export BLIP_COMMIT_HASH=""
42
+
43
+ # Uncomment to enable accelerated launch
44
+ #export ACCELERATE="True"
45
+
46
+ ###########################################
webui.bat ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @echo off
2
+
3
+ if not defined PYTHON (set PYTHON=python)
4
+ if not defined VENV_DIR (set VENV_DIR=venv)
5
+
6
+ set ERROR_REPORTING=FALSE
7
+
8
+ mkdir tmp 2>NUL
9
+
10
+ %PYTHON% -c "" >tmp/stdout.txt 2>tmp/stderr.txt
11
+ if %ERRORLEVEL% == 0 goto :start_venv
12
+ echo Couldn't launch python
13
+ goto :show_stdout_stderr
14
+
15
+ :start_venv
16
+ if [%VENV_DIR%] == [-] goto :skip_venv
17
+
18
+ dir %VENV_DIR%\Scripts\Python.exe >tmp/stdout.txt 2>tmp/stderr.txt
19
+ if %ERRORLEVEL% == 0 goto :activate_venv
20
+
21
+ for /f "delims=" %%i in ('CALL %PYTHON% -c "import sys; print(sys.executable)"') do set PYTHON_FULLNAME="%%i"
22
+ echo Creating venv in directory %VENV_DIR% using python %PYTHON_FULLNAME%
23
+ %PYTHON_FULLNAME% -m venv %VENV_DIR% >tmp/stdout.txt 2>tmp/stderr.txt
24
+ if %ERRORLEVEL% == 0 goto :activate_venv
25
+ echo Unable to create venv in directory %VENV_DIR%
26
+ goto :show_stdout_stderr
27
+
28
+ :activate_venv
29
+ set PYTHON="%~dp0%VENV_DIR%\Scripts\Python.exe"
30
+ echo venv %PYTHON%
31
+ if [%ACCELERATE%] == ["True"] goto :accelerate
32
+ goto :launch
33
+
34
+ :skip_venv
35
+
36
+ :accelerate
37
+ echo "Checking for accelerate"
38
+ set ACCELERATE="%~dp0%VENV_DIR%\Scripts\accelerate.exe"
39
+ if EXIST %ACCELERATE% goto :accelerate_launch
40
+
41
+ :launch
42
+ %PYTHON% launch.py %*
43
+ pause
44
+ exit /b
45
+
46
+ :accelerate_launch
47
+ echo "Accelerating"
48
+ %ACCELERATE% launch --num_cpu_threads_per_process=6 launch.py
49
+ pause
50
+ exit /b
51
+
52
+ :show_stdout_stderr
53
+
54
+ echo.
55
+ echo exit code: %errorlevel%
56
+
57
+ for /f %%i in ("tmp\stdout.txt") do set size=%%~zi
58
+ if %size% equ 0 goto :show_stderr
59
+ echo.
60
+ echo stdout:
61
+ type tmp\stdout.txt
62
+
63
+ :show_stderr
64
+ for /f %%i in ("tmp\stderr.txt") do set size=%%~zi
65
+ if %size% equ 0 goto :show_stderr
66
+ echo.
67
+ echo stderr:
68
+ type tmp\stderr.txt
69
+
70
+ :endofscript
71
+
72
+ echo.
73
+ echo Launch unsuccessful. Exiting.
74
+ pause
webui.py ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import threading
3
+ import time
4
+ import importlib
5
+ import signal
6
+ import threading
7
+ from fastapi import FastAPI
8
+ from fastapi.middleware.cors import CORSMiddleware
9
+ from fastapi.middleware.gzip import GZipMiddleware
10
+
11
+ from modules.call_queue import wrap_queued_call, queue_lock, wrap_gradio_gpu_call
12
+ from modules.paths import script_path
13
+
14
+ from modules import shared, devices, sd_samplers, upscaler, extensions, localization, ui_tempdir
15
+ import modules.codeformer_model as codeformer
16
+ import modules.extras
17
+ import modules.face_restoration
18
+ import modules.gfpgan_model as gfpgan
19
+ import modules.img2img
20
+
21
+ import modules.lowvram
22
+ import modules.paths
23
+ import modules.scripts
24
+ import modules.sd_hijack
25
+ import modules.sd_models
26
+ import modules.sd_vae
27
+ import modules.txt2img
28
+ import modules.script_callbacks
29
+
30
+ import modules.ui
31
+ from modules import modelloader
32
+ from modules.shared import cmd_opts
33
+ import modules.hypernetworks.hypernetwork
34
+
35
+
36
+ if cmd_opts.server_name:
37
+ server_name = cmd_opts.server_name
38
+ else:
39
+ server_name = "0.0.0.0" if cmd_opts.listen else None
40
+
41
+
42
+ def initialize():
43
+ extensions.list_extensions()
44
+ localization.list_localizations(cmd_opts.localizations_dir)
45
+
46
+ if cmd_opts.ui_debug_mode:
47
+ shared.sd_upscalers = upscaler.UpscalerLanczos().scalers
48
+ modules.scripts.load_scripts()
49
+ return
50
+
51
+ modelloader.cleanup_models()
52
+ modules.sd_models.setup_model()
53
+ codeformer.setup_model(cmd_opts.codeformer_models_path)
54
+ gfpgan.setup_model(cmd_opts.gfpgan_models_path)
55
+ shared.face_restorers.append(modules.face_restoration.FaceRestoration())
56
+
57
+ modules.scripts.load_scripts()
58
+
59
+ modelloader.load_upscalers()
60
+
61
+ modules.sd_vae.refresh_vae_list()
62
+ modules.sd_models.load_model()
63
+ shared.opts.onchange("sd_model_checkpoint", wrap_queued_call(lambda: modules.sd_models.reload_model_weights()))
64
+ shared.opts.onchange("sd_vae", wrap_queued_call(lambda: modules.sd_vae.reload_vae_weights()), call=False)
65
+ shared.opts.onchange("sd_vae_as_default", wrap_queued_call(lambda: modules.sd_vae.reload_vae_weights()), call=False)
66
+ shared.opts.onchange("sd_hypernetwork", wrap_queued_call(lambda: shared.reload_hypernetworks()))
67
+ shared.opts.onchange("sd_hypernetwork_strength", modules.hypernetworks.hypernetwork.apply_strength)
68
+ shared.opts.onchange("temp_dir", ui_tempdir.on_tmpdir_changed)
69
+
70
+ if cmd_opts.tls_keyfile is not None and cmd_opts.tls_keyfile is not None:
71
+
72
+ try:
73
+ if not os.path.exists(cmd_opts.tls_keyfile):
74
+ print("Invalid path to TLS keyfile given")
75
+ if not os.path.exists(cmd_opts.tls_certfile):
76
+ print(f"Invalid path to TLS certfile: '{cmd_opts.tls_certfile}'")
77
+ except TypeError:
78
+ cmd_opts.tls_keyfile = cmd_opts.tls_certfile = None
79
+ print("TLS setup invalid, running webui without TLS")
80
+ else:
81
+ print("Running with TLS")
82
+
83
+ # make the program just exit at ctrl+c without waiting for anything
84
+ def sigint_handler(sig, frame):
85
+ print(f'Interrupted with signal {sig} in {frame}')
86
+ os._exit(0)
87
+
88
+ signal.signal(signal.SIGINT, sigint_handler)
89
+
90
+
91
+ def setup_cors(app):
92
+ if cmd_opts.cors_allow_origins and cmd_opts.cors_allow_origins_regex:
93
+ app.add_middleware(CORSMiddleware, allow_origins=cmd_opts.cors_allow_origins.split(','), allow_origin_regex=cmd_opts.cors_allow_origins_regex, allow_methods=['*'])
94
+ elif cmd_opts.cors_allow_origins:
95
+ app.add_middleware(CORSMiddleware, allow_origins=cmd_opts.cors_allow_origins.split(','), allow_methods=['*'])
96
+ elif cmd_opts.cors_allow_origins_regex:
97
+ app.add_middleware(CORSMiddleware, allow_origin_regex=cmd_opts.cors_allow_origins_regex, allow_methods=['*'])
98
+
99
+
100
+ def create_api(app):
101
+ from modules.api.api import Api
102
+ api = Api(app, queue_lock)
103
+ return api
104
+
105
+
106
+ def wait_on_server(demo=None):
107
+ while 1:
108
+ time.sleep(0.5)
109
+ if shared.state.need_restart:
110
+ shared.state.need_restart = False
111
+ time.sleep(0.5)
112
+ demo.close()
113
+ time.sleep(0.5)
114
+ break
115
+
116
+
117
+ def api_only():
118
+ initialize()
119
+
120
+ app = FastAPI()
121
+ setup_cors(app)
122
+ app.add_middleware(GZipMiddleware, minimum_size=1000)
123
+ api = create_api(app)
124
+
125
+ modules.script_callbacks.app_started_callback(None, app)
126
+
127
+ api.launch(server_name="0.0.0.0" if cmd_opts.listen else "127.0.0.1", port=cmd_opts.port if cmd_opts.port else 7861)
128
+
129
+
130
+ def webui():
131
+ launch_api = cmd_opts.api
132
+ initialize()
133
+
134
+ while 1:
135
+ if shared.opts.clean_temp_dir_at_start:
136
+ ui_tempdir.cleanup_tmpdr()
137
+
138
+ shared.demo = modules.ui.create_ui()
139
+
140
+ app, local_url, share_url = shared.demo.queue(default_enabled=False).launch(
141
+ share=cmd_opts.share,
142
+ server_name=server_name,
143
+ server_port=cmd_opts.port,
144
+ ssl_keyfile=cmd_opts.tls_keyfile,
145
+ ssl_certfile=cmd_opts.tls_certfile,
146
+ debug=cmd_opts.gradio_debug,
147
+ auth=[tuple(cred.split(':')) for cred in cmd_opts.gradio_auth.strip('"').split(',')] if cmd_opts.gradio_auth else None,
148
+ inbrowser=cmd_opts.autolaunch,
149
+ prevent_thread_lock=True
150
+ )
151
+ # after initial launch, disable --autolaunch for subsequent restarts
152
+ cmd_opts.autolaunch = False
153
+
154
+ # gradio uses a very open CORS policy via app.user_middleware, which makes it possible for
155
+ # an attacker to trick the user into opening a malicious HTML page, which makes a request to the
156
+ # running web ui and do whatever the attcker wants, including installing an extension and
157
+ # runnnig its code. We disable this here. Suggested by RyotaK.
158
+ app.user_middleware = [x for x in app.user_middleware if x.cls.__name__ != 'CORSMiddleware']
159
+
160
+ setup_cors(app)
161
+
162
+ app.add_middleware(GZipMiddleware, minimum_size=1000)
163
+
164
+ if launch_api:
165
+ create_api(app)
166
+
167
+ modules.script_callbacks.app_started_callback(shared.demo, app)
168
+ modules.script_callbacks.app_started_callback(shared.demo, app)
169
+
170
+ wait_on_server(shared.demo)
171
+
172
+ sd_samplers.set_samplers()
173
+
174
+ print('Reloading extensions')
175
+ extensions.list_extensions()
176
+
177
+ localization.list_localizations(cmd_opts.localizations_dir)
178
+
179
+ print('Reloading custom scripts')
180
+ modules.scripts.reload_scripts()
181
+ modelloader.load_upscalers()
182
+
183
+ print('Reloading modules: modules.ui')
184
+ importlib.reload(modules.ui)
185
+ print('Refreshing Model List')
186
+ modules.sd_models.list_models()
187
+ print('Restarting Gradio')
188
+
189
+
190
+ if __name__ == "__main__":
191
+ if cmd_opts.nowebui:
192
+ api_only()
193
+ else:
194
+ webui()
webui.sh ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ #################################################
3
+ # Please do not make any changes to this file, #
4
+ # change the variables in webui-user.sh instead #
5
+ #################################################
6
+
7
+ # If run from macOS, load defaults from webui-macos-env.sh
8
+ if [[ "$OSTYPE" == "darwin"* ]]; then
9
+ if [[ -f webui-macos-env.sh ]]
10
+ then
11
+ source ./webui-macos-env.sh
12
+ fi
13
+ fi
14
+
15
+ # Read variables from webui-user.sh
16
+ # shellcheck source=/dev/null
17
+ if [[ -f webui-user.sh ]]
18
+ then
19
+ source ./webui-user.sh
20
+ fi
21
+
22
+ # Set defaults
23
+ # Install directory without trailing slash
24
+ if [[ -z "${install_dir}" ]]
25
+ then
26
+ install_dir="/home/$(whoami)"
27
+ fi
28
+
29
+ # Name of the subdirectory (defaults to stable-diffusion-webui)
30
+ if [[ -z "${clone_dir}" ]]
31
+ then
32
+ clone_dir="stable-diffusion-webui"
33
+ fi
34
+
35
+ # python3 executable
36
+ if [[ -z "${python_cmd}" ]]
37
+ then
38
+ python_cmd="python3"
39
+ fi
40
+
41
+ # git executable
42
+ if [[ -z "${GIT}" ]]
43
+ then
44
+ export GIT="git"
45
+ fi
46
+
47
+ # python3 venv without trailing slash (defaults to ${install_dir}/${clone_dir}/venv)
48
+ if [[ -z "${venv_dir}" ]]
49
+ then
50
+ venv_dir="venv"
51
+ fi
52
+
53
+ if [[ -z "${LAUNCH_SCRIPT}" ]]
54
+ then
55
+ LAUNCH_SCRIPT="launch.py"
56
+ fi
57
+
58
+ # this script cannot be run as root by default
59
+ can_run_as_root=0
60
+
61
+ # read any command line flags to the webui.sh script
62
+ while getopts "f" flag > /dev/null 2>&1
63
+ do
64
+ case ${flag} in
65
+ f) can_run_as_root=1;;
66
+ *) break;;
67
+ esac
68
+ done
69
+
70
+ # Disable sentry logging
71
+ export ERROR_REPORTING=FALSE
72
+
73
+ # Do not reinstall existing pip packages on Debian/Ubuntu
74
+ export PIP_IGNORE_INSTALLED=0
75
+
76
+ # Pretty print
77
+ delimiter="################################################################"
78
+
79
+ printf "\n%s\n" "${delimiter}"
80
+ printf "\e[1m\e[32mInstall script for stable-diffusion + Web UI\n"
81
+ printf "\e[1m\e[34mTested on Debian 11 (Bullseye)\e[0m"
82
+ printf "\n%s\n" "${delimiter}"
83
+
84
+ # Do not run as root
85
+ if [[ $(id -u) -eq 0 && can_run_as_root -eq 0 ]]
86
+ then
87
+ printf "\n%s\n" "${delimiter}"
88
+ printf "\e[1m\e[31mERROR: This script must not be launched as root, aborting...\e[0m"
89
+ printf "\n%s\n" "${delimiter}"
90
+ exit 1
91
+ else
92
+ printf "\n%s\n" "${delimiter}"
93
+ printf "Running on \e[1m\e[32m%s\e[0m user" "$(whoami)"
94
+ printf "\n%s\n" "${delimiter}"
95
+ fi
96
+
97
+ if [[ -d .git ]]
98
+ then
99
+ printf "\n%s\n" "${delimiter}"
100
+ printf "Repo already cloned, using it as install directory"
101
+ printf "\n%s\n" "${delimiter}"
102
+ install_dir="${PWD}/../"
103
+ clone_dir="${PWD##*/}"
104
+ fi
105
+
106
+ # Check prerequisites
107
+ for preq in "${GIT}" "${python_cmd}"
108
+ do
109
+ if ! hash "${preq}" &>/dev/null
110
+ then
111
+ printf "\n%s\n" "${delimiter}"
112
+ printf "\e[1m\e[31mERROR: %s is not installed, aborting...\e[0m" "${preq}"
113
+ printf "\n%s\n" "${delimiter}"
114
+ exit 1
115
+ fi
116
+ done
117
+
118
+ if ! "${python_cmd}" -c "import venv" &>/dev/null
119
+ then
120
+ printf "\n%s\n" "${delimiter}"
121
+ printf "\e[1m\e[31mERROR: python3-venv is not installed, aborting...\e[0m"
122
+ printf "\n%s\n" "${delimiter}"
123
+ exit 1
124
+ fi
125
+
126
+ cd "${install_dir}"/ || { printf "\e[1m\e[31mERROR: Can't cd to %s/, aborting...\e[0m" "${install_dir}"; exit 1; }
127
+ if [[ -d "${clone_dir}" ]]
128
+ then
129
+ cd "${clone_dir}"/ || { printf "\e[1m\e[31mERROR: Can't cd to %s/%s/, aborting...\e[0m" "${install_dir}" "${clone_dir}"; exit 1; }
130
+ else
131
+ printf "\n%s\n" "${delimiter}"
132
+ printf "Clone stable-diffusion-webui"
133
+ printf "\n%s\n" "${delimiter}"
134
+ "${GIT}" clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git "${clone_dir}"
135
+ cd "${clone_dir}"/ || { printf "\e[1m\e[31mERROR: Can't cd to %s/%s/, aborting...\e[0m" "${install_dir}" "${clone_dir}"; exit 1; }
136
+ fi
137
+
138
+ printf "\n%s\n" "${delimiter}"
139
+ printf "Create and activate python venv"
140
+ printf "\n%s\n" "${delimiter}"
141
+ cd "${install_dir}"/"${clone_dir}"/ || { printf "\e[1m\e[31mERROR: Can't cd to %s/%s/, aborting...\e[0m" "${install_dir}" "${clone_dir}"; exit 1; }
142
+ if [[ ! -d "${venv_dir}" ]]
143
+ then
144
+ "${python_cmd}" -m venv "${venv_dir}"
145
+ first_launch=1
146
+ fi
147
+ # shellcheck source=/dev/null
148
+ if [[ -f "${venv_dir}"/bin/activate ]]
149
+ then
150
+ source "${venv_dir}"/bin/activate
151
+ else
152
+ printf "\n%s\n" "${delimiter}"
153
+ printf "\e[1m\e[31mERROR: Cannot activate python venv, aborting...\e[0m"
154
+ printf "\n%s\n" "${delimiter}"
155
+ exit 1
156
+ fi
157
+
158
+ if [[ ! -z "${ACCELERATE}" ]] && [ ${ACCELERATE}="True" ] && [ -x "$(command -v accelerate)" ]
159
+ then
160
+ printf "\n%s\n" "${delimiter}"
161
+ printf "Accelerating launch.py..."
162
+ printf "\n%s\n" "${delimiter}"
163
+ accelerate launch --num_cpu_threads_per_process=6 "${LAUNCH_SCRIPT}" "$@"
164
+ else
165
+ printf "\n%s\n" "${delimiter}"
166
+ printf "Launching launch.py..."
167
+ printf "\n%s\n" "${delimiter}"
168
+ "${python_cmd}" "${LAUNCH_SCRIPT}" "$@"
169
+ fi