Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -64,12 +64,12 @@ download_file("https://huggingface.co/ai-forever/Real-ESRGAN/resolve/main/RealES
|
|
| 64 |
|
| 65 |
# Download the model files
|
| 66 |
ckpt_dir_realpony = snapshot_download(repo_id="silveroxides/RNS_RealPonyV20")
|
| 67 |
-
|
| 68 |
ckpt_dir_hybridpony = snapshot_download(repo_id="silveroxides/RealHybridPony")
|
| 69 |
|
| 70 |
# Load the models
|
| 71 |
vae_realpony = AutoencoderKL.from_pretrained(os.path.join(ckpt_dir_realpony, "vae"), torch_dtype=torch.float16)
|
| 72 |
-
|
| 73 |
vae_hybridpony = AutoencoderKL.from_pretrained(os.path.join(ckpt_dir_hybridpony, "vae"), torch_dtype=torch.float16)
|
| 74 |
|
| 75 |
pipe_realpony = StableDiffusionXLPipeline.from_pretrained(
|
|
@@ -79,9 +79,9 @@ pipe_realpony = StableDiffusionXLPipeline.from_pretrained(
|
|
| 79 |
torch_dtype=torch.float16,
|
| 80 |
use_safetensors=True,
|
| 81 |
)
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
vae=
|
| 85 |
custom_pipeline="multimodalart/sdxl_perturbed_attention_guidance",
|
| 86 |
torch_dtype=torch.float16,
|
| 87 |
use_safetensors=True,
|
|
@@ -95,11 +95,11 @@ pipe_hybridpony = StableDiffusionXLPipeline.from_pretrained(
|
|
| 95 |
)
|
| 96 |
|
| 97 |
pipe_realpony = pipe_realpony.to("cuda")
|
| 98 |
-
|
| 99 |
pipe_hybridpony = pipe_hybridpony.to("cuda")
|
| 100 |
|
| 101 |
pipe_realpony.unet.set_attn_processor(AttnProcessor2_0())
|
| 102 |
-
|
| 103 |
pipe_hybridpony.unet.set_attn_processor(AttnProcessor2_0())
|
| 104 |
|
| 105 |
# Define samplers
|
|
@@ -216,8 +216,8 @@ def generate_image(model_choice, additional_positive_prompt, additional_negative
|
|
| 216 |
# Select the appropriate pipe based on the model choice
|
| 217 |
if model_choice == "Real Pony RNS":
|
| 218 |
pipe = pipe_realpony
|
| 219 |
-
elif model_choice == "
|
| 220 |
-
pipe =
|
| 221 |
else: # "Hybrid Pony SDXL"
|
| 222 |
pipe = pipe_hybridpony
|
| 223 |
|
|
@@ -305,9 +305,9 @@ with gr.Blocks(theme='bethecloud/storj_theme') as demo:
|
|
| 305 |
gr.HTML("""
|
| 306 |
<h1 align="center">Real Pony RNS / Ultimate Pony RNS / Hybrid Pony SDXL</h1>
|
| 307 |
<p align="center">
|
| 308 |
-
<a href="https://huggingface.co/silveroxides/RNS_RealPonyV20" target="_blank">[
|
| 309 |
-
<a href="https://huggingface.co/silveroxides/
|
| 310 |
-
<a href="https://huggingface.co/silveroxides/RealHybridPony" target="_blank">[
|
| 311 |
<a href="https://huggingface.co/microsoft/Florence-2-base" target="_blank">[Florence-2 Model]</a>
|
| 312 |
<a href="https://huggingface.co/gokaygokay/Lamini-Prompt-Enchance-Long" target="_blank">[Prompt Enhancer Long]</a>
|
| 313 |
<a href="https://huggingface.co/gokaygokay/Lamini-Prompt-Enchance" target="_blank">[Prompt Enhancer Medium]</a>
|
|
@@ -317,7 +317,7 @@ with gr.Blocks(theme='bethecloud/storj_theme') as demo:
|
|
| 317 |
with gr.Row():
|
| 318 |
with gr.Column(scale=1):
|
| 319 |
model_choice = gr.Dropdown(
|
| 320 |
-
["Real Pony RNS", "
|
| 321 |
label="Model Choice",
|
| 322 |
value="Real Pony RNS")
|
| 323 |
positive_prompt = gr.Textbox(label="Positive Prompt", placeholder="Add your positive prompt here")
|
|
|
|
| 64 |
|
| 65 |
# Download the model files
|
| 66 |
ckpt_dir_realpony = snapshot_download(repo_id="silveroxides/RNS_RealPonyV20")
|
| 67 |
+
ckpt_dir_noobai = snapshot_download(repo_id="silveroxides/NoobAI-XL-EPS-1.0-Vwe")
|
| 68 |
ckpt_dir_hybridpony = snapshot_download(repo_id="silveroxides/RealHybridPony")
|
| 69 |
|
| 70 |
# Load the models
|
| 71 |
vae_realpony = AutoencoderKL.from_pretrained(os.path.join(ckpt_dir_realpony, "vae"), torch_dtype=torch.float16)
|
| 72 |
+
vae_noobai = AutoencoderKL.from_pretrained(os.path.join(ckpt_dir_noobai, "vae"), torch_dtype=torch.float16)
|
| 73 |
vae_hybridpony = AutoencoderKL.from_pretrained(os.path.join(ckpt_dir_hybridpony, "vae"), torch_dtype=torch.float16)
|
| 74 |
|
| 75 |
pipe_realpony = StableDiffusionXLPipeline.from_pretrained(
|
|
|
|
| 79 |
torch_dtype=torch.float16,
|
| 80 |
use_safetensors=True,
|
| 81 |
)
|
| 82 |
+
pipe_noobai = StableDiffusionXLPipeline.from_pretrained(
|
| 83 |
+
ckpt_dir_noobai,
|
| 84 |
+
vae=vae_noobai,
|
| 85 |
custom_pipeline="multimodalart/sdxl_perturbed_attention_guidance",
|
| 86 |
torch_dtype=torch.float16,
|
| 87 |
use_safetensors=True,
|
|
|
|
| 95 |
)
|
| 96 |
|
| 97 |
pipe_realpony = pipe_realpony.to("cuda")
|
| 98 |
+
pipe_noobai = pipe_noobai.to("cuda")
|
| 99 |
pipe_hybridpony = pipe_hybridpony.to("cuda")
|
| 100 |
|
| 101 |
pipe_realpony.unet.set_attn_processor(AttnProcessor2_0())
|
| 102 |
+
pipe_noobai.unet.set_attn_processor(AttnProcessor2_0())
|
| 103 |
pipe_hybridpony.unet.set_attn_processor(AttnProcessor2_0())
|
| 104 |
|
| 105 |
# Define samplers
|
|
|
|
| 216 |
# Select the appropriate pipe based on the model choice
|
| 217 |
if model_choice == "Real Pony RNS":
|
| 218 |
pipe = pipe_realpony
|
| 219 |
+
elif model_choice == "NoobAI-XL EPS 1.0":
|
| 220 |
+
pipe = pipe_noobai
|
| 221 |
else: # "Hybrid Pony SDXL"
|
| 222 |
pipe = pipe_hybridpony
|
| 223 |
|
|
|
|
| 305 |
gr.HTML("""
|
| 306 |
<h1 align="center">Real Pony RNS / Ultimate Pony RNS / Hybrid Pony SDXL</h1>
|
| 307 |
<p align="center">
|
| 308 |
+
<a href="https://huggingface.co/silveroxides/RNS_RealPonyV20" target="_blank">[RNS RealPony]</a>
|
| 309 |
+
<a href="https://huggingface.co/silveroxides/NoobAI-XL-EPS-1.0-Vwe" target="_blank">[NoobAI-XL EPS 1.0]</a>
|
| 310 |
+
<a href="https://huggingface.co/silveroxides/RealHybridPony" target="_blank">[Hybrid Pony SDXL]</a><br>
|
| 311 |
<a href="https://huggingface.co/microsoft/Florence-2-base" target="_blank">[Florence-2 Model]</a>
|
| 312 |
<a href="https://huggingface.co/gokaygokay/Lamini-Prompt-Enchance-Long" target="_blank">[Prompt Enhancer Long]</a>
|
| 313 |
<a href="https://huggingface.co/gokaygokay/Lamini-Prompt-Enchance" target="_blank">[Prompt Enhancer Medium]</a>
|
|
|
|
| 317 |
with gr.Row():
|
| 318 |
with gr.Column(scale=1):
|
| 319 |
model_choice = gr.Dropdown(
|
| 320 |
+
["Real Pony RNS", "NoobAI-XL EPS 1.0", "Hybrid Pony SDXL"],
|
| 321 |
label="Model Choice",
|
| 322 |
value="Real Pony RNS")
|
| 323 |
positive_prompt = gr.Textbox(label="Positive Prompt", placeholder="Add your positive prompt here")
|