Spaces:
Running
on
Zero
Running
on
Zero
add default prompt
Browse files- app.py +23 -25
- config.py +7 -7
- models/checkpoints.py +8 -0
- models/vae.py +9 -0
app.py
CHANGED
@@ -29,6 +29,8 @@ from config import (
|
|
29 |
DEFAULT_NEGATIVE_PROMPT,
|
30 |
DEFAULT_POSITIVE_PROMPT
|
31 |
)
|
|
|
|
|
32 |
|
33 |
preprocessor_controlnet = {
|
34 |
"openpose": [
|
@@ -183,25 +185,6 @@ os.makedirs(directory_loras, exist_ok=True)
|
|
183 |
directory_vaes = 'vaes'
|
184 |
os.makedirs(directory_vaes, exist_ok=True)
|
185 |
|
186 |
-
# - **Download SD 1.5 Models**
|
187 |
-
download_model = (
|
188 |
-
"https://civitai.com/api/download/models/597138, "
|
189 |
-
"https://civitai.com/api/download/models/469243, "
|
190 |
-
"https://civitai.com/api/download/models/609052, "
|
191 |
-
"https://civitai.com/api/download/models/5036?type=Model&format=SafeTensor&size=full&fp=fp16, "
|
192 |
-
"https://civitai.com/api/download/models/574369, "
|
193 |
-
"https://huggingface.co/TechnoByte/MilkyWonderland/resolve/main/milkyWonderland_v40.safetensors"
|
194 |
-
)
|
195 |
-
# - **Download VAEs**
|
196 |
-
download_vae = (
|
197 |
-
"https://civitai.com/api/download/models/128078, "
|
198 |
-
"https://huggingface.co/stabilityai/sdxl-vae/resolve/main/sdxl_vae.safetensors, "
|
199 |
-
"https://civitai.com/api/download/models/403131?type=VAE&format=SafeTensor, "
|
200 |
-
"https://huggingface.co/nubby/blessed-sdxl-vae-fp16-fix/resolve/main/sdxl_vae-fp16fix-c-1.1-b-0.5.safetensors?download=true, "
|
201 |
-
"https://huggingface.co/nubby/blessed-sdxl-vae-fp16-fix/resolve/main/sdxl_vae-fp16fix-blessed.safetensors?download=true, "
|
202 |
-
"https://huggingface.co/digiplay/VAE/resolve/main/vividReal_v20.safetensors?download=true, "
|
203 |
-
"https://huggingface.co/fp16-guy/anything_kl-f8-anime2_vae-ft-mse-840000-ema-pruned_blessed_clearvae_fp16_cleaned/resolve/main/vae-ft-mse-840000-ema-pruned_fp16.safetensors?download=true"
|
204 |
-
)
|
205 |
# - **Download LoRAs**
|
206 |
download_lora = (
|
207 |
"https://civitai.com/api/download/models/423719, "
|
@@ -253,8 +236,8 @@ load_diffusers_format_model = [
|
|
253 |
'rubbrband/realcartoonRealistic_v14',
|
254 |
]
|
255 |
|
256 |
-
CIVITAI_API_KEY = os.environ.get("CIVITAI_API_KEY")
|
257 |
-
hf_token = os.environ.get("HF_TOKEN")
|
258 |
|
259 |
# Download stuffs
|
260 |
for url in [url.strip() for url in download_model.split(',')]:
|
@@ -1162,7 +1145,12 @@ with gr.Blocks(theme="NoCrypt/miku", css=CSS) as app:
|
|
1162 |
with gr.Accordion("IP-Adapter", open=False, visible=True): ##############
|
1163 |
|
1164 |
IP_MODELS = sorted(list(set(IP_ADAPTERS_SD + IP_ADAPTERS_SDXL)))
|
1165 |
-
MODE_IP_OPTIONS = [
|
|
|
|
|
|
|
|
|
|
|
1166 |
|
1167 |
with gr.Accordion("IP-Adapter 1", open=False, visible=True):
|
1168 |
image_ip1 = gr.Image(label="IP Image", type="filepath")
|
@@ -1178,10 +1166,20 @@ with gr.Blocks(theme="NoCrypt/miku", css=CSS) as app:
|
|
1178 |
scale_ip2 = gr.Slider(minimum=0., maximum=2., step=0.01, value=0.7, label="Scale")
|
1179 |
|
1180 |
with gr.Accordion("ControlNet / Img2img / Inpaint", open=False, visible=True):
|
1181 |
-
image_control = gr.Image(
|
1182 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1183 |
strength_gui = gr.Slider(
|
1184 |
-
minimum=0.01,
|
|
|
|
|
|
|
|
|
1185 |
info="This option adjusts the level of changes for img2img and inpainting."
|
1186 |
)
|
1187 |
image_resolution_gui = gr.Slider(
|
|
|
29 |
DEFAULT_NEGATIVE_PROMPT,
|
30 |
DEFAULT_POSITIVE_PROMPT
|
31 |
)
|
32 |
+
from models.vae import VAE_LIST as download_vae
|
33 |
+
from models.checkpoints import CHECKPOINT_LIST as download_model
|
34 |
|
35 |
preprocessor_controlnet = {
|
36 |
"openpose": [
|
|
|
185 |
directory_vaes = 'vaes'
|
186 |
os.makedirs(directory_vaes, exist_ok=True)
|
187 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
# - **Download LoRAs**
|
189 |
download_lora = (
|
190 |
"https://civitai.com/api/download/models/423719, "
|
|
|
236 |
'rubbrband/realcartoonRealistic_v14',
|
237 |
]
|
238 |
|
239 |
+
CIVITAI_API_KEY: str = os.environ.get("CIVITAI_API_KEY")
|
240 |
+
hf_token: str = os.environ.get("HF_TOKEN")
|
241 |
|
242 |
# Download stuffs
|
243 |
for url in [url.strip() for url in download_model.split(',')]:
|
|
|
1145 |
with gr.Accordion("IP-Adapter", open=False, visible=True): ##############
|
1146 |
|
1147 |
IP_MODELS = sorted(list(set(IP_ADAPTERS_SD + IP_ADAPTERS_SDXL)))
|
1148 |
+
MODE_IP_OPTIONS = [
|
1149 |
+
"original",
|
1150 |
+
"style",
|
1151 |
+
"layout",
|
1152 |
+
"style+layout"
|
1153 |
+
]
|
1154 |
|
1155 |
with gr.Accordion("IP-Adapter 1", open=False, visible=True):
|
1156 |
image_ip1 = gr.Image(label="IP Image", type="filepath")
|
|
|
1166 |
scale_ip2 = gr.Slider(minimum=0., maximum=2., step=0.01, value=0.7, label="Scale")
|
1167 |
|
1168 |
with gr.Accordion("ControlNet / Img2img / Inpaint", open=False, visible=True):
|
1169 |
+
image_control = gr.Image(
|
1170 |
+
label="Image ControlNet/Inpaint/Img2img",
|
1171 |
+
type="filepath"
|
1172 |
+
)
|
1173 |
+
image_mask_gui = gr.Image(
|
1174 |
+
label="Image Mask",
|
1175 |
+
type="filepath"
|
1176 |
+
)
|
1177 |
strength_gui = gr.Slider(
|
1178 |
+
minimum=0.01,
|
1179 |
+
maximum=1.0,
|
1180 |
+
step=0.01,
|
1181 |
+
value=0.55,
|
1182 |
+
label="Strength",
|
1183 |
info="This option adjusts the level of changes for img2img and inpainting."
|
1184 |
)
|
1185 |
image_resolution_gui = gr.Slider(
|
config.py
CHANGED
@@ -1,12 +1,7 @@
|
|
1 |
MINIMUM_IMAGE_NUMBER = 1
|
2 |
MAXIMUM_IMAGE_NUMBER = 10
|
3 |
-
DEFAULT_NEGATIVE_PROMPT = """(EasyNegative:1.05), easynegative, bad_prompt_version2, (poorly rendered), ugly, disfigured,
|
4 |
-
cross eyed, cloned face, bad symmetry, bad anatomy, low quality, blurry, text, watermark, logo,
|
5 |
-
signature, jpeg, artifacts, monochrome, paintings, oil, (hands:1.15), European Woman, woman,
|
6 |
-
noise, dark skin, (3d), By bad artist -neg,bhands-neg, canvas frame, (badly drawn), (badly painted),
|
7 |
-
"""
|
8 |
|
9 |
-
DEFAULT_POSITIVE_PROMPT = """1girl,
|
10 |
(basketball court), sweaty, dribble, high detailed, sunny, day light,
|
11 |
|
12 |
score_9, score_8_up, score_7_up, very aesthetic,
|
@@ -26,5 +21,10 @@ five fingers,
|
|
26 |
two hands,
|
27 |
short girl, narrow body, detailed face, petite,
|
28 |
medium boobs,
|
29 |
-
armpits, (naval),
|
|
|
|
|
|
|
|
|
|
|
30 |
"""
|
|
|
1 |
MINIMUM_IMAGE_NUMBER = 1
|
2 |
MAXIMUM_IMAGE_NUMBER = 10
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
+
DEFAULT_POSITIVE_PROMPT = """1girl, serious, cocky, sporty, basketball jersey, lakers, basketball, half body,
|
5 |
(basketball court), sweaty, dribble, high detailed, sunny, day light,
|
6 |
|
7 |
score_9, score_8_up, score_7_up, very aesthetic,
|
|
|
21 |
two hands,
|
22 |
short girl, narrow body, detailed face, petite,
|
23 |
medium boobs,
|
24 |
+
(armpits, (naval), crop top), outdoor
|
25 |
+
"""
|
26 |
+
DEFAULT_NEGATIVE_PROMPT = """(EasyNegative:1.05), easynegative, bad_prompt_version2, (poorly rendered), ugly, disfigured,
|
27 |
+
cross eyed, cloned face, bad symmetry, bad anatomy, low quality, blurry, text, watermark, logo,
|
28 |
+
signature, jpeg, artifacts, monochrome, paintings, oil, (hands:1.15), European Woman, woman,
|
29 |
+
noise, dark skin, (3d), By bad artist -neg,bhands-neg, canvas frame, (badly drawn), (badly painted),
|
30 |
"""
|
models/checkpoints.py
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
CHECKPOINT_LIST = (
|
2 |
+
"https://civitai.com/api/download/models/597138, "
|
3 |
+
"https://civitai.com/api/download/models/469243, "
|
4 |
+
"https://civitai.com/api/download/models/609052, "
|
5 |
+
"https://civitai.com/api/download/models/5036?type=Model&format=SafeTensor&size=full&fp=fp16, "
|
6 |
+
"https://civitai.com/api/download/models/574369, "
|
7 |
+
"https://huggingface.co/TechnoByte/MilkyWonderland/resolve/main/milkyWonderland_v40.safetensors"
|
8 |
+
)
|
models/vae.py
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
VAE_LIST = (
|
2 |
+
"https://civitai.com/api/download/models/128078, "
|
3 |
+
"https://huggingface.co/stabilityai/sdxl-vae/resolve/main/sdxl_vae.safetensors, "
|
4 |
+
"https://civitai.com/api/download/models/403131?type=VAE&format=SafeTensor, "
|
5 |
+
"https://huggingface.co/nubby/blessed-sdxl-vae-fp16-fix/resolve/main/sdxl_vae-fp16fix-c-1.1-b-0.5.safetensors?download=true, "
|
6 |
+
"https://huggingface.co/nubby/blessed-sdxl-vae-fp16-fix/resolve/main/sdxl_vae-fp16fix-blessed.safetensors?download=true, "
|
7 |
+
"https://huggingface.co/digiplay/VAE/resolve/main/vividReal_v20.safetensors?download=true, "
|
8 |
+
"https://huggingface.co/fp16-guy/anything_kl-f8-anime2_vae-ft-mse-840000-ema-pruned_blessed_clearvae_fp16_cleaned/resolve/main/vae-ft-mse-840000-ema-pruned_fp16.safetensors?download=true"
|
9 |
+
)
|