Spaces:
Paused
Paused
Christian
commited on
Commit
·
1727c65
1
Parent(s):
6b16ae8
New app
Browse files- .gitignore +0 -44
- app.py +26 -6
- embeddings/Place Textual Inversion embeddings here.txt +0 -0
- extensions/put extensions here.txt +0 -0
- models/Stable-diffusion/Put Stable Diffusion checkpoints here.txt +0 -0
- models/VAE-approx/model.pt +3 -0
- models/VAE/Put VAE here.txt +0 -0
- models/deepbooru/Put your deepbooru release project folder here.txt +0 -0
- models/karlo/ViT-L-14_stats.th +0 -0
- test/test_outputs/.gitkeep +0 -0
- webui-user.bat +8 -0
- webui-user.sh +48 -0
.gitignore
DELETED
|
@@ -1,44 +0,0 @@
|
|
| 1 |
-
__pycache__
|
| 2 |
-
*.ckpt
|
| 3 |
-
*.safetensors
|
| 4 |
-
*.pth
|
| 5 |
-
.DS_Store
|
| 6 |
-
/ESRGAN/*
|
| 7 |
-
/SwinIR/*
|
| 8 |
-
/repositories
|
| 9 |
-
/venv
|
| 10 |
-
/tmp
|
| 11 |
-
/model.ckpt
|
| 12 |
-
/models/**/*
|
| 13 |
-
/GFPGANv1.3.pth
|
| 14 |
-
/gfpgan/weights/*.pth
|
| 15 |
-
/ui-config.json
|
| 16 |
-
/outputs
|
| 17 |
-
/config.json
|
| 18 |
-
/log
|
| 19 |
-
/webui.settings.bat
|
| 20 |
-
/embeddings
|
| 21 |
-
/styles.csv
|
| 22 |
-
/params.txt
|
| 23 |
-
/styles.csv.bak
|
| 24 |
-
/webui-user.bat
|
| 25 |
-
/webui-user.sh
|
| 26 |
-
/interrogate
|
| 27 |
-
/user.css
|
| 28 |
-
/.idea
|
| 29 |
-
notification.mp3
|
| 30 |
-
/SwinIR
|
| 31 |
-
/textual_inversion
|
| 32 |
-
.vscode
|
| 33 |
-
/extensions
|
| 34 |
-
/test/stdout.txt
|
| 35 |
-
/test/stderr.txt
|
| 36 |
-
/cache.json*
|
| 37 |
-
/config_states/
|
| 38 |
-
/node_modules
|
| 39 |
-
/package-lock.json
|
| 40 |
-
/.coverage*
|
| 41 |
-
/test/test_outputs
|
| 42 |
-
/cache
|
| 43 |
-
trace.json
|
| 44 |
-
/sysinfo-????-??-??-??-??.json
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.py
CHANGED
|
@@ -1,15 +1,35 @@
|
|
| 1 |
import os
|
| 2 |
import subprocess
|
|
|
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
# Hugging Face Spaces usa la variabile d'ambiente PORT
|
| 11 |
port = os.getenv("PORT", "7860")
|
| 12 |
|
| 13 |
# Aggiungi il parametro --skip-torch-cuda-test per forzare l'uso della CPU
|
| 14 |
-
subprocess.run(["python3", "launch.py", "--skip-torch-cuda-test", "--port", port])
|
| 15 |
-
|
|
|
|
| 1 |
import os
|
| 2 |
import subprocess
|
| 3 |
+
from huggingface_hub import hf_hub_download
|
| 4 |
|
| 5 |
+
model_dir_stablediffusion = "models/Stable-diffusion/"
|
| 6 |
+
os.makedirs(model_dir_stablediffusion, exist_ok=True)
|
| 7 |
|
| 8 |
+
model_dir_controlnet = "models/ControlNet/"
|
| 9 |
+
os.makedirs(model_dir_controlnet, exist_ok=True)
|
| 10 |
+
|
| 11 |
+
model_dir_ESRGAN = "models/ESRGAN"
|
| 12 |
+
os.makedirs(model_dir_ESRGAN, exist_ok=True)
|
| 13 |
+
|
| 14 |
+
model_dir_VAEapprox = "models/VAE-approx"
|
| 15 |
+
os.makedirs(model_dir_VAEapprox, exist_ok=True)
|
| 16 |
+
|
| 17 |
+
model_dir_lora = "models/Lora"
|
| 18 |
+
os.makedirs(model_dir_lora, exist_ok=True)
|
| 19 |
+
|
| 20 |
+
model_dir_karlo = "models/karlo"
|
| 21 |
+
os.makedirs(model_dir_karlo, exist_ok=True)
|
| 22 |
+
|
| 23 |
+
model_path = hf_hub_download(repo_id="PietroC01/ImgEnhancerModels", filename="juggernaut_reborn.safetensors", local_dir=model_dir_stablediffusion)
|
| 24 |
+
model_path = hf_hub_download(repo_id="PietroC01/ImgEnhancerModels", filename="control_v11f1e_sd15_tile.pth", local_dir=model_dir_controlnet)
|
| 25 |
+
model_path = hf_hub_download(repo_id="PietroC01/ImgEnhancerModels", filename="4x-UltraSharp.pth", local_dir=model_dir_ESRGAN)
|
| 26 |
+
model_path = hf_hub_download(repo_id="PietroC01/ImgEnhancerModels", filename="model.pt", local_dir=model_dir_VAEapprox)
|
| 27 |
+
model_path = hf_hub_download(repo_id="PietroC01/ImgEnhancerModels", filename="more_details.safetensors", local_dir=model_dir_lora)
|
| 28 |
+
model_path = hf_hub_download(repo_id="PietroC01/ImgEnhancerModels", filename="SDXLrender_v2.0.safetensors", local_dir=model_dir_lora)
|
| 29 |
+
model_path = hf_hub_download(repo_id="PietroC01/ImgEnhancerModels", filename="ViT-L-14_stats.th", local_dir=model_dir_karlo)
|
| 30 |
|
| 31 |
# Hugging Face Spaces usa la variabile d'ambiente PORT
|
| 32 |
port = os.getenv("PORT", "7860")
|
| 33 |
|
| 34 |
# Aggiungi il parametro --skip-torch-cuda-test per forzare l'uso della CPU
|
| 35 |
+
subprocess.run(["python3", "launch.py", "--skip-torch-cuda-test", "--port", port])
|
|
|
embeddings/Place Textual Inversion embeddings here.txt
ADDED
|
File without changes
|
extensions/put extensions here.txt
ADDED
|
File without changes
|
models/Stable-diffusion/Put Stable Diffusion checkpoints here.txt
ADDED
|
File without changes
|
models/VAE-approx/model.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4f88c9078bb2238cdd0d8864671dd33e3f42e091e41f08903f3c15e4a54a9b39
|
| 3 |
+
size 213777
|
models/VAE/Put VAE here.txt
ADDED
|
File without changes
|
models/deepbooru/Put your deepbooru release project folder here.txt
ADDED
|
File without changes
|
models/karlo/ViT-L-14_stats.th
ADDED
|
Binary file (7.08 kB). View file
|
|
|
test/test_outputs/.gitkeep
ADDED
|
File without changes
|
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,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 CODEFORMER_COMMIT_HASH=""
|
| 40 |
+
#export BLIP_COMMIT_HASH=""
|
| 41 |
+
|
| 42 |
+
# Uncomment to enable accelerated launch
|
| 43 |
+
#export ACCELERATE="True"
|
| 44 |
+
|
| 45 |
+
# Uncomment to disable TCMalloc
|
| 46 |
+
#export NO_TCMALLOC="True"
|
| 47 |
+
|
| 48 |
+
###########################################
|