Upload 3 files
Browse filesstable-diffusion template
- README.md +20 -0
- app.py +59 -0
- config.json +114 -0
README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Stable Diffusion Web UI
|
| 3 |
+
emoji: 🚧
|
| 4 |
+
colorFrom: yellow
|
| 5 |
+
colorTo: yellow
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: 3.9
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
duplicated_from: camenduru/webui
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
## Stable Diffusion Web UI
|
| 14 |
+
[https://github.com/AUTOMATIC1111/stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui)
|
| 15 |
+
|
| 16 |
+
## Documentation
|
| 17 |
+
[https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki)
|
| 18 |
+
|
| 19 |
+
## Models License
|
| 20 |
+
https://huggingface.co/spaces/CompVis/stable-diffusion-license
|
app.py
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
from subprocess import getoutput
|
| 3 |
+
|
| 4 |
+
gpu_info = getoutput('nvidia-smi')
|
| 5 |
+
if("A10G" in gpu_info):
|
| 6 |
+
os.system(f"pip install -q https://github.com/camenduru/stable-diffusion-webui-colab/releases/download/0.0.15/xformers-0.0.15.dev0+4c06c79.d20221205-cp38-cp38-linux_x86_64.whl")
|
| 7 |
+
elif("T4" in gpu_info):
|
| 8 |
+
os.system(f"pip install -q https://github.com/camenduru/stable-diffusion-webui-colab/releases/download/0.0.15/xformers-0.0.15.dev0+1515f77.d20221130-cp38-cp38-linux_x86_64.whl")
|
| 9 |
+
|
| 10 |
+
os.system(f"git clone https://github.com/camenduru/stable-diffusion-webui /home/user/app/stable-diffusion-webui")
|
| 11 |
+
os.chdir("/home/user/app/stable-diffusion-webui")
|
| 12 |
+
|
| 13 |
+
os.system(f"wget -q https://github.com/camenduru/webui/raw/main/env_patch.py -O /home/user/app/env_patch.py")
|
| 14 |
+
os.system(f"sed -i -e '/import image_from_url_text/r /home/user/app/env_patch.py' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
| 15 |
+
os.system(f"sed -i -e '/(modelmerger_interface, \"Checkpoint Merger\", \"modelmerger\"),/d' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
| 16 |
+
os.system(f"sed -i -e '/(train_interface, \"Train\", \"ti\"),/d' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
| 17 |
+
os.system(f"sed -i -e '/extensions_interface, \"Extensions\", \"extensions\"/d' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
| 18 |
+
os.system(f"sed -i -e '/settings_interface, \"Settings\", \"settings\"/d' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
| 19 |
+
os.system(f'''sed -i -e "s/document.getElementsByTagName('gradio-app')\[0\].shadowRoot/!!document.getElementsByTagName('gradio-app')[0].shadowRoot ? document.getElementsByTagName('gradio-app')[0].shadowRoot : document/g" /home/user/app/stable-diffusion-webui/script.js''')
|
| 20 |
+
os.system(f"sed -i -e 's/ show_progress=False,/ show_progress=True,/g' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
| 21 |
+
os.system(f"sed -i -e 's/shared.demo.launch/shared.demo.queue().launch/g' /home/user/app/stable-diffusion-webui/webui.py")
|
| 22 |
+
os.system(f"sed -i -e 's/inputs=\[component\],/&\\n queue=False,/g' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
| 23 |
+
os.system(f"sed -i -e 's/outputs=\[token_counter\]/outputs=[token_counter], queue=False/g' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
| 24 |
+
|
| 25 |
+
# ----------------------------Please duplicate this space and delete this block if you don't want to see the extra header----------------------------
|
| 26 |
+
os.system(f"wget -q https://github.com/camenduru/webui/raw/main/header_patch.py -O /home/user/app/header_patch.py")
|
| 27 |
+
os.system(f"sed -i -e '/demo:/r /home/user/app/header_patch.py' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
| 28 |
+
# ---------------------------------------------------------------------------------------------------------------------------------------------------
|
| 29 |
+
|
| 30 |
+
os.system(f"wget -q https://huggingface.co/Linaqruf/anything-v3.0/resolve/main/Anything-V3.0-pruned.ckpt -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/Anything-V3.0-pruned.ckpt")
|
| 31 |
+
os.system(f"wget -q https://huggingface.co/Linaqruf/anything-v3.0/resolve/main/Anything-V3.0.vae.pt -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/Anything-V3.0-pruned.vae.pt")
|
| 32 |
+
|
| 33 |
+
if "IS_SHARED_UI" in os.environ:
|
| 34 |
+
os.system(f"wget -q https://github.com/camenduru/webui/raw/main/shared-config.json -O /home/user/app/shared-config.json")
|
| 35 |
+
os.system(f"wget -q https://github.com/camenduru/webui/raw/main/shared-ui-config.json -O /home/user/app/shared-ui-config.json")
|
| 36 |
+
os.system(f"python launch.py --force-enable-xformers --disable-console-progressbars --enable-console-prompts --ui-config-file /home/user/app/shared-ui-config.json --ui-settings-file /home/user/app/shared-config.json --cors-allow-origins huggingface.co,hf.space --no-progressbar-hiding")
|
| 37 |
+
else:
|
| 38 |
+
# Please duplicate this space and delete # character in front of the custom script you want to use or add here more custom scripts with same structure os.system(f"wget -q https://CUSTOM_SCRIPT_URL -O /home/user/app/stable-diffusion-webui/scripts/CUSTOM_SCRIPT_NAME.py")
|
| 39 |
+
os.system(f"wget -q https://gist.github.com/camenduru/9ec5f8141db9902e375967e93250860f/raw/d0bcf01786f20107c329c03f8968584ee67be12a/run_n_times.py -O /home/user/app/stable-diffusion-webui/scripts/run_n_times.py")
|
| 40 |
+
|
| 41 |
+
# Please duplicate this space and delete # character in front of the extension you want to use or add here more extensions with same structure os.system(f"git clone https://EXTENSION_GIT_URL /home/user/app/stable-diffusion-webui/extensions/EXTENSION_NAME")
|
| 42 |
+
#os.system(f"git clone https://github.com/camenduru/stable-diffusion-webui-artists-to-study /home/user/app/stable-diffusion-webui/extensions/stable-diffusion-webui-artists-to-study")
|
| 43 |
+
os.system(f"git clone https://github.com/yfszzx/stable-diffusion-webui-images-browser /home/user/app/stable-diffusion-webui/extensions/stable-diffusion-webui-images-browser")
|
| 44 |
+
os.system(f"git clone https://github.com/deforum-art/deforum-for-automatic1111-webui /home/user/app/stable-diffusion-webui/extensions/deforum-for-automatic1111-webui")
|
| 45 |
+
|
| 46 |
+
# Please duplicate this space and delete # character in front of the model you want to use or add here more ckpts with same structure os.system(f"wget -q https://CKPT_URL -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/CKPT_NAME.ckpt")
|
| 47 |
+
#os.system(f"wget -q https://huggingface.co/nitrosocke/Arcane-Diffusion/resolve/main/arcane-diffusion-v3.ckpt -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/arcane-diffusion-v3.ckpt")
|
| 48 |
+
#os.system(f"wget -q https://huggingface.co/DGSpitzer/Cyberpunk-Anime-Diffusion/resolve/main/Cyberpunk-Anime-Diffusion.ckpt -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/Cyberpunk-Anime-Diffusion.ckpt")
|
| 49 |
+
#os.system(f"wget -q https://huggingface.co/prompthero/midjourney-v4-diffusion/resolve/main/mdjrny-v4.ckpt -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/mdjrny-v4.ckpt")
|
| 50 |
+
#os.system(f"wget -q https://huggingface.co/nitrosocke/mo-di-diffusion/resolve/main/moDi-v1-pruned.ckpt -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/moDi-v1-pruned.ckpt")
|
| 51 |
+
#os.system(f"wget -q https://huggingface.co/Fictiverse/Stable_Diffusion_PaperCut_Model/resolve/main/PaperCut_v1.ckpt -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/PaperCut_v1.ckpt")
|
| 52 |
+
#os.system(f"wget -q https://huggingface.co/lilpotat/sa/resolve/main/samdoesarts_style.ckpt -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/samdoesarts_style.ckpt")
|
| 53 |
+
#os.system(f"wget -q https://huggingface.co/hakurei/waifu-diffusion-v1-3/resolve/main/wd-v1-3-float32.ckpt -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/wd-v1-3-float32.ckpt")
|
| 54 |
+
#os.system(f"wget -q https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/sd-v1-4.ckpt")
|
| 55 |
+
#os.system(f"wget -q https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.ckpt")
|
| 56 |
+
#os.system(f"wget -q https://huggingface.co/runwayml/stable-diffusion-inpainting/resolve/main/sd-v1-5-inpainting.ckpt -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/sd-v1-5-inpainting.ckpt")
|
| 57 |
+
#os.system(f"wget -q https://huggingface.co/stabilityai/stable-diffusion-2/resolve/main/768-v-ema.ckpt -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/768-v-ema.ckpt")
|
| 58 |
+
#os.system(f"wget -q https://raw.githubusercontent.com/Stability-AI/stablediffusion/main/configs/stable-diffusion/v2-inference-v.yaml -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/768-v-ema.yaml")
|
| 59 |
+
os.system(f"python launch.py --force-enable-xformers --ui-config-file /home/user/app/ui-config.json --ui-settings-file /home/user/app/config.json --disable-console-progressbars --enable-console-prompts --cors-allow-origins huggingface.co,hf.space --no-progressbar-hiding --api --skip-torch-cuda-test")
|
config.json
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"samples_save": true,
|
| 3 |
+
"samples_format": "png",
|
| 4 |
+
"samples_filename_pattern": "",
|
| 5 |
+
"save_images_add_number": true,
|
| 6 |
+
"grid_save": true,
|
| 7 |
+
"grid_format": "png",
|
| 8 |
+
"grid_extended_filename": false,
|
| 9 |
+
"grid_only_if_multiple": true,
|
| 10 |
+
"grid_prevent_empty_spots": false,
|
| 11 |
+
"n_rows": -1,
|
| 12 |
+
"enable_pnginfo": true,
|
| 13 |
+
"save_txt": false,
|
| 14 |
+
"save_images_before_face_restoration": false,
|
| 15 |
+
"save_images_before_highres_fix": false,
|
| 16 |
+
"save_images_before_color_correction": false,
|
| 17 |
+
"jpeg_quality": 80,
|
| 18 |
+
"export_for_4chan": true,
|
| 19 |
+
"use_original_name_batch": false,
|
| 20 |
+
"save_selected_only": true,
|
| 21 |
+
"do_not_add_watermark": false,
|
| 22 |
+
"temp_dir": "",
|
| 23 |
+
"clean_temp_dir_at_start": false,
|
| 24 |
+
"outdir_samples": "",
|
| 25 |
+
"outdir_txt2img_samples": "outputs/txt2img-images",
|
| 26 |
+
"outdir_img2img_samples": "outputs/img2img-images",
|
| 27 |
+
"outdir_extras_samples": "outputs/extras-images",
|
| 28 |
+
"outdir_grids": "",
|
| 29 |
+
"outdir_txt2img_grids": "outputs/txt2img-grids",
|
| 30 |
+
"outdir_img2img_grids": "outputs/img2img-grids",
|
| 31 |
+
"outdir_save": "log/images",
|
| 32 |
+
"save_to_dirs": false,
|
| 33 |
+
"grid_save_to_dirs": false,
|
| 34 |
+
"use_save_to_dirs_for_ui": false,
|
| 35 |
+
"directories_filename_pattern": "",
|
| 36 |
+
"directories_max_prompt_words": 8,
|
| 37 |
+
"ESRGAN_tile": 192,
|
| 38 |
+
"ESRGAN_tile_overlap": 8,
|
| 39 |
+
"realesrgan_enabled_models": [
|
| 40 |
+
"R-ESRGAN 4x+",
|
| 41 |
+
"R-ESRGAN 4x+ Anime6B"
|
| 42 |
+
],
|
| 43 |
+
"upscaler_for_img2img": null,
|
| 44 |
+
"use_scale_latent_for_hires_fix": false,
|
| 45 |
+
"face_restoration_model": null,
|
| 46 |
+
"code_former_weight": 0.5,
|
| 47 |
+
"face_restoration_unload": false,
|
| 48 |
+
"memmon_poll_rate": 8,
|
| 49 |
+
"samples_log_stdout": false,
|
| 50 |
+
"multiple_tqdm": true,
|
| 51 |
+
"unload_models_when_training": false,
|
| 52 |
+
"pin_memory": false,
|
| 53 |
+
"save_optimizer_state": false,
|
| 54 |
+
"dataset_filename_word_regex": "",
|
| 55 |
+
"dataset_filename_join_string": " ",
|
| 56 |
+
"training_image_repeats_per_epoch": 1,
|
| 57 |
+
"training_write_csv_every": 500,
|
| 58 |
+
"training_xattention_optimizations": false,
|
| 59 |
+
"sd_model_checkpoint": null,
|
| 60 |
+
"sd_checkpoint_cache": 0,
|
| 61 |
+
"sd_vae": "auto",
|
| 62 |
+
"sd_vae_as_default": false,
|
| 63 |
+
"sd_hypernetwork": "None",
|
| 64 |
+
"sd_hypernetwork_strength": 1.0,
|
| 65 |
+
"inpainting_mask_weight": 1.0,
|
| 66 |
+
"img2img_color_correction": false,
|
| 67 |
+
"img2img_fix_steps": false,
|
| 68 |
+
"enable_quantization": false,
|
| 69 |
+
"enable_emphasis": true,
|
| 70 |
+
"use_old_emphasis_implementation": false,
|
| 71 |
+
"enable_batch_seeds": true,
|
| 72 |
+
"comma_padding_backtrack": 20,
|
| 73 |
+
"filter_nsfw": false,
|
| 74 |
+
"CLIP_stop_at_last_layers": 1,
|
| 75 |
+
"random_artist_categories": [],
|
| 76 |
+
"interrogate_keep_models_in_memory": false,
|
| 77 |
+
"interrogate_use_builtin_artists": true,
|
| 78 |
+
"interrogate_return_ranks": false,
|
| 79 |
+
"interrogate_clip_num_beams": 1,
|
| 80 |
+
"interrogate_clip_min_length": 24,
|
| 81 |
+
"interrogate_clip_max_length": 48,
|
| 82 |
+
"interrogate_clip_dict_limit": 1500,
|
| 83 |
+
"interrogate_deepbooru_score_threshold": 0.5,
|
| 84 |
+
"deepbooru_sort_alpha": true,
|
| 85 |
+
"deepbooru_use_spaces": false,
|
| 86 |
+
"deepbooru_escape": true,
|
| 87 |
+
"show_progressbar": true,
|
| 88 |
+
"show_progress_every_n_steps": 0,
|
| 89 |
+
"show_progress_grid": true,
|
| 90 |
+
"return_grid": true,
|
| 91 |
+
"do_not_show_images": false,
|
| 92 |
+
"add_model_hash_to_info": true,
|
| 93 |
+
"add_model_name_to_info": false,
|
| 94 |
+
"disable_weights_auto_swap": false,
|
| 95 |
+
"send_seed": true,
|
| 96 |
+
"font": "",
|
| 97 |
+
"js_modal_lightbox": true,
|
| 98 |
+
"js_modal_lightbox_initially_zoomed": true,
|
| 99 |
+
"show_progress_in_title": true,
|
| 100 |
+
"quicksettings": "sd_model_checkpoint",
|
| 101 |
+
"localization": "None",
|
| 102 |
+
"hide_samplers": [],
|
| 103 |
+
"eta_ddim": 0.0,
|
| 104 |
+
"eta_ancestral": 1.0,
|
| 105 |
+
"ddim_discretize": "uniform",
|
| 106 |
+
"s_churn": 0.0,
|
| 107 |
+
"s_tmin": 0.0,
|
| 108 |
+
"s_noise": 1.0,
|
| 109 |
+
"eta_noise_seed_delta": 0,
|
| 110 |
+
"disabled_extensions": [],
|
| 111 |
+
"ldsr_steps": 100,
|
| 112 |
+
"SWIN_tile": 192,
|
| 113 |
+
"SWIN_tile_overlap": 8
|
| 114 |
+
}
|