Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,9 +31,9 @@ async def generate_image(prompt, model, lora_word, width, height, scales, steps,
|
|
| 31 |
image = await client.text_to_image(prompt=text, height=height, width=width, guidance_scale=scales, num_inference_steps=steps, model=model)
|
| 32 |
return image, seed
|
| 33 |
|
| 34 |
-
async def gen(prompt, basemodel,
|
| 35 |
-
model =
|
| 36 |
-
image, seed = await generate_image(prompt, model,
|
| 37 |
image_path = "temp_image.png"
|
| 38 |
image.save(image_path)
|
| 39 |
|
|
@@ -65,7 +65,7 @@ with gr.Blocks(css=CSS, js=JS, theme="Nymbo/Nymbo_Theme") as demo:
|
|
| 65 |
with gr.Column(scale=0.8):
|
| 66 |
prompt = gr.Textbox(label="Prompt")
|
| 67 |
basemodel_choice = gr.Dropdown(label="Base Model", choices=["black-forest-labs/FLUX.1-schnell", "black-forest-labs/FLUX.1-DEV"], value="black-forest-labs/FLUX.1-schnell")
|
| 68 |
-
lora_model_choice = gr.Dropdown(label="LORA Model", choices=["Shakker-Labs/FLUX.1-dev-LoRA-add-details", "
|
| 69 |
process_lora = gr.Checkbox(label="Process LORA", value=True)
|
| 70 |
upscale_factor = gr.Radio(label="UpScale Factor", choices=[2, 4, 8], value=2, scale=2)
|
| 71 |
process_upscale = gr.Checkbox(label="Process Upscale", value=False)
|
|
@@ -76,8 +76,6 @@ with gr.Blocks(css=CSS, js=JS, theme="Nymbo/Nymbo_Theme") as demo:
|
|
| 76 |
scales = gr.Slider(label="Guidance", minimum=3.5, maximum=7, step=0.1, value=3.5)
|
| 77 |
steps = gr.Slider(label="Steps", minimum=1, maximum=100, step=1, value=24)
|
| 78 |
seed = gr.Slider(label="Seeds", minimum=-1, maximum=MAX_SEED, step=1, value=-1)
|
| 79 |
-
lora_add = gr.Textbox(label="Add Flux LoRA", info="Modelo Lora", lines=1, value="XLabs-AI/flux-RealismLora")
|
| 80 |
-
lora_word = gr.Textbox(label="Add Flux LoRA Trigger Word", info="Add the Trigger Word", lines=1, value="")
|
| 81 |
|
| 82 |
submit_btn = gr.Button("Submit", scale=1)
|
| 83 |
submit_btn.click(
|
|
@@ -87,7 +85,7 @@ with gr.Blocks(css=CSS, js=JS, theme="Nymbo/Nymbo_Theme") as demo:
|
|
| 87 |
queue=False
|
| 88 |
).then(
|
| 89 |
fn=gen,
|
| 90 |
-
inputs=[prompt, basemodel_choice,
|
| 91 |
outputs=[output_res]
|
| 92 |
)
|
| 93 |
demo.launch()
|
|
|
|
| 31 |
image = await client.text_to_image(prompt=text, height=height, width=width, guidance_scale=scales, num_inference_steps=steps, model=model)
|
| 32 |
return image, seed
|
| 33 |
|
| 34 |
+
async def gen(prompt, basemodel, width, height, scales, steps, seed, upscale_factor, process_upscale, lora_model, process_lora):
|
| 35 |
+
model = lora_model
|
| 36 |
+
image, seed = await generate_image(prompt, model, "", width, height, scales, steps, seed)
|
| 37 |
image_path = "temp_image.png"
|
| 38 |
image.save(image_path)
|
| 39 |
|
|
|
|
| 65 |
with gr.Column(scale=0.8):
|
| 66 |
prompt = gr.Textbox(label="Prompt")
|
| 67 |
basemodel_choice = gr.Dropdown(label="Base Model", choices=["black-forest-labs/FLUX.1-schnell", "black-forest-labs/FLUX.1-DEV"], value="black-forest-labs/FLUX.1-schnell")
|
| 68 |
+
lora_model_choice = gr.Dropdown(label="LORA Model", choices=["Shakker-Labs/FLUX.1-dev-LoRA-add-details", "XLabs-AI/flux-RealismLora"])
|
| 69 |
process_lora = gr.Checkbox(label="Process LORA", value=True)
|
| 70 |
upscale_factor = gr.Radio(label="UpScale Factor", choices=[2, 4, 8], value=2, scale=2)
|
| 71 |
process_upscale = gr.Checkbox(label="Process Upscale", value=False)
|
|
|
|
| 76 |
scales = gr.Slider(label="Guidance", minimum=3.5, maximum=7, step=0.1, value=3.5)
|
| 77 |
steps = gr.Slider(label="Steps", minimum=1, maximum=100, step=1, value=24)
|
| 78 |
seed = gr.Slider(label="Seeds", minimum=-1, maximum=MAX_SEED, step=1, value=-1)
|
|
|
|
|
|
|
| 79 |
|
| 80 |
submit_btn = gr.Button("Submit", scale=1)
|
| 81 |
submit_btn.click(
|
|
|
|
| 85 |
queue=False
|
| 86 |
).then(
|
| 87 |
fn=gen,
|
| 88 |
+
inputs=[prompt, basemodel_choice, width, height, scales, steps, seed, upscale_factor, process_upscale, lora_model_choice, process_lora],
|
| 89 |
outputs=[output_res]
|
| 90 |
)
|
| 91 |
demo.launch()
|