Update app.py
Browse files
app.py
CHANGED
|
@@ -42,6 +42,7 @@ repo_customs = {
|
|
| 42 |
"Default": repo_default,
|
| 43 |
"Realistic": StableDiffusionXLPipeline.from_pretrained("stablediffusionapi/NightVision_XL", vae=vae, controlnet=controlnet, torch_dtype=torch.float16, use_safetensors=False, add_watermarker=False),
|
| 44 |
"Anime": StableDiffusionXLPipeline.from_pretrained("cagliostrolab/animagine-xl-3.1", vae=vae, controlnet=controlnet, torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False),
|
|
|
|
| 45 |
}
|
| 46 |
|
| 47 |
# Functions
|
|
@@ -73,6 +74,9 @@ def generate(input=DEFAULT_INPUT, filter_input="", negative_input=DEFAULT_NEGATI
|
|
| 73 |
elif model == "Anime":
|
| 74 |
steps = (not steps or steps < 0 and 16) or steps
|
| 75 |
guidance = (not guidance or guidance < 0 and 7) or guidance
|
|
|
|
|
|
|
|
|
|
| 76 |
else:
|
| 77 |
steps = (not steps or steps < 0 and 16) or steps
|
| 78 |
guidance = (not guidance or guidance < 0 and 3) or guidance
|
|
@@ -112,7 +116,7 @@ with gr.Blocks(css=css) as main:
|
|
| 112 |
input = gr.Textbox(lines=1, value=DEFAULT_INPUT, label="Input")
|
| 113 |
filter_input = gr.Textbox(lines=1, value="", label="Input Filter")
|
| 114 |
negative_input = gr.Textbox(lines=1, value=DEFAULT_NEGATIVE_INPUT, label="Input Negative")
|
| 115 |
-
model = gr.Dropdown(label="Models", choices=["Default", "Realistic", "Anime"], value="Default")
|
| 116 |
height = gr.Slider(minimum=1, maximum=2160, step=1, value=DEFAULT_HEIGHT, label="Height")
|
| 117 |
width = gr.Slider(minimum=1, maximum=2160, step=1, value=DEFAULT_WIDTH, label="Width")
|
| 118 |
steps = gr.Slider(minimum=-1, maximum=100, step=1, value=-1, label="Steps")
|
|
|
|
| 42 |
"Default": repo_default,
|
| 43 |
"Realistic": StableDiffusionXLPipeline.from_pretrained("stablediffusionapi/NightVision_XL", vae=vae, controlnet=controlnet, torch_dtype=torch.float16, use_safetensors=False, add_watermarker=False),
|
| 44 |
"Anime": StableDiffusionXLPipeline.from_pretrained("cagliostrolab/animagine-xl-3.1", vae=vae, controlnet=controlnet, torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False),
|
| 45 |
+
"Pixel": StableDiffusionXLPipeline.from_pretrained("PublicPrompts/All-In-One-Pixel-Model", vae=vae, controlnet=controlnet, torch_dtype=torch.float16, use_safetensors=True, add_watermarker=False),
|
| 46 |
}
|
| 47 |
|
| 48 |
# Functions
|
|
|
|
| 74 |
elif model == "Anime":
|
| 75 |
steps = (not steps or steps < 0 and 16) or steps
|
| 76 |
guidance = (not guidance or guidance < 0 and 7) or guidance
|
| 77 |
+
elif model == "Pixel":
|
| 78 |
+
steps = (not steps or steps < 0 and 8) or steps
|
| 79 |
+
guidance = (not guidance or guidance < 0 and 3) or guidance
|
| 80 |
else:
|
| 81 |
steps = (not steps or steps < 0 and 16) or steps
|
| 82 |
guidance = (not guidance or guidance < 0 and 3) or guidance
|
|
|
|
| 116 |
input = gr.Textbox(lines=1, value=DEFAULT_INPUT, label="Input")
|
| 117 |
filter_input = gr.Textbox(lines=1, value="", label="Input Filter")
|
| 118 |
negative_input = gr.Textbox(lines=1, value=DEFAULT_NEGATIVE_INPUT, label="Input Negative")
|
| 119 |
+
model = gr.Dropdown(label="Models", choices=["Default", "Realistic", "Anime", "Pixel"], value="Default")
|
| 120 |
height = gr.Slider(minimum=1, maximum=2160, step=1, value=DEFAULT_HEIGHT, label="Height")
|
| 121 |
width = gr.Slider(minimum=1, maximum=2160, step=1, value=DEFAULT_WIDTH, label="Width")
|
| 122 |
steps = gr.Slider(minimum=-1, maximum=100, step=1, value=-1, label="Steps")
|