Update app.py
Browse files
app.py
CHANGED
@@ -57,7 +57,7 @@ async def gen(prompt, basemodel, width, height, scales, steps, seed, upscale_fac
|
|
57 |
upscale_image.save("upscale_image.jpg", format="JPEG")
|
58 |
return [image_path, "upscale_image.jpg"]
|
59 |
else:
|
60 |
-
print("Error:
|
61 |
return [image_path, image_path]
|
62 |
else:
|
63 |
return [image_path, image_path]
|
@@ -72,20 +72,20 @@ with gr.Blocks(css=css, theme="Nymbo/Nymbo_Theme") as demo:
|
|
72 |
with gr.Column(scale=3):
|
73 |
output_res = ImageSlider(label="Flux / Upscaled")
|
74 |
with gr.Column(scale=2):
|
75 |
-
prompt = gr.Textbox(label="
|
76 |
-
basemodel_choice = gr.Dropdown(label="
|
77 |
-
lora_model_choice = gr.Dropdown(label="
|
78 |
-
process_lora = gr.Checkbox(label="
|
79 |
-
process_upscale = gr.Checkbox(label="
|
80 |
-
upscale_factor = gr.Radio(label="Factor
|
81 |
|
82 |
-
with gr.Accordion(label="
|
83 |
-
width = gr.Slider(label="
|
84 |
-
height = gr.Slider(label="
|
85 |
-
scales = gr.Slider(label="
|
86 |
-
steps = gr.Slider(label="
|
87 |
-
seed = gr.Number(label="
|
88 |
|
89 |
-
btn = gr.Button("
|
90 |
btn.click(fn=gen, inputs=[prompt, basemodel_choice, width, height, scales, steps, seed, upscale_factor, process_upscale, lora_model_choice, process_lora], outputs=output_res,)
|
91 |
demo.launch()
|
|
|
57 |
upscale_image.save("upscale_image.jpg", format="JPEG")
|
58 |
return [image_path, "upscale_image.jpg"]
|
59 |
else:
|
60 |
+
print("Error: The scaled image path is None")
|
61 |
return [image_path, image_path]
|
62 |
else:
|
63 |
return [image_path, image_path]
|
|
|
72 |
with gr.Column(scale=3):
|
73 |
output_res = ImageSlider(label="Flux / Upscaled")
|
74 |
with gr.Column(scale=2):
|
75 |
+
prompt = gr.Textbox(label="Image Description")
|
76 |
+
basemodel_choice = gr.Dropdown(label="Model", choices=["black-forest-labs/FLUX.1-schnell", "black-forest-labs/FLUX.1-DEV", "enhanceaiteam/Flux-uncensored", "Shakker-Labs/FLUX.1-dev-ControlNet-Union-Pro", "Shakker-Labs/FLUX.1-dev-LoRA-add-details", "city96/FLUX.1-dev-gguf"], value="black-forest-labs/FLUX.1-schnell")
|
77 |
+
lora_model_choice = gr.Dropdown(label="LoRA", choices=["Shakker-Labs/FLUX.1-dev-LoRA-add-details", "XLabs-AI/flux-RealismLora", "enhanceaiteam/Flux-uncensored"], value="XLabs-AI/flux-RealismLora")
|
78 |
+
process_lora = gr.Checkbox(label="LoRA Process")
|
79 |
+
process_upscale = gr.Checkbox(label="Scale Process")
|
80 |
+
upscale_factor = gr.Radio(label="Scaling Factor", choices=[2, 4, 8], value=2)
|
81 |
|
82 |
+
with gr.Accordion(label="Advanced Options", open=False):
|
83 |
+
width = gr.Slider(label="Width", minimum=512, maximum=1280, step=8, value=1280)
|
84 |
+
height = gr.Slider(label="Height", minimum=512, maximum=1280, step=8, value=768)
|
85 |
+
scales = gr.Slider(label="Scale", minimum=1, maximum=20, step=1, value=8)
|
86 |
+
steps = gr.Slider(label="Steps", minimum=1, maximum=100, step=1, value=8)
|
87 |
+
seed = gr.Number(label="Seed", value=-1)
|
88 |
|
89 |
+
btn = gr.Button("Generate")
|
90 |
btn.click(fn=gen, inputs=[prompt, basemodel_choice, width, height, scales, steps, seed, upscale_factor, process_upscale, lora_model_choice, process_lora], outputs=output_res,)
|
91 |
demo.launch()
|