|
import gradio as gr |
|
from comfypulid import generate_image |
|
|
|
if __name__ == "__main__": |
|
|
|
|
|
|
|
with gr.Blocks(theme=gr.themes.Ocean(primary_hue="indigo", neutral_hue="gray", font=[gr.themes.GoogleFont("Montserrat"), "Playwrite England SemiJoine", "Quicksand"])) as app: |
|
|
|
gr.Markdown("# FLUX Style Shaping") |
|
|
|
with gr.Row(): |
|
with gr.Column(): |
|
|
|
prompt_input = gr.Textbox(label="Prompt", placeholder="Enter your prompt here...") |
|
|
|
with gr.Row(): |
|
|
|
with gr.Group(): |
|
structure_image = gr.Image(label="Structure Image", type="filepath") |
|
depth_strength = gr.Slider(minimum=0, maximum=50, value=15, label="Depth Strength") |
|
|
|
with gr.Group(): |
|
style_image = gr.Image(label="Style Image", type="filepath") |
|
style_strength = gr.Slider(minimum=0, maximum=1, value=0.5, label="Style Strength") |
|
|
|
|
|
generate_btn = gr.Button("Generate") |
|
|
|
with gr.Column(): |
|
|
|
output_image = gr.Image(label="Generated Image") |
|
|
|
|
|
|
|
generate_btn.click( |
|
fn=generate_image, |
|
inputs=[prompt_input, structure_image, style_image, depth_strength, style_strength], |
|
outputs=[output_image] |
|
) |
|
app.launch() |
|
|