picasoe / app.py
unfavalen's picture
Update app.py
021585a verified
import gradio as gr
def generate_image(prompt, image_size="Default", num_inference_steps=28, seed="random", guidance_scale=3.5, sync_mode=True, num_images=1):
# Load the model (assuming it supports these parameters)
model = gr.load("models/robiai/picasoe", provider="hf-inference")
# Implement image generation logic here
# Return the generated image
pass
with gr.Blocks(title="Picasoe") as demo:
gr.Markdown("# Picasoe")
gr.Markdown("Convert your ideas into jaw-dropping visuals.")
with gr.Row():
with gr.Column():
# Input components
prompt = gr.Textbox(label="Prompt", placeholder="Describe the image you want to generate...")
image_size = gr.Dropdown(
choices=["Default", "Square", "Square HD", "Portrait 3:4", "Portrait 9:16", "Landscape 4:3", "Landscape 16:9", "Custom"],
label="Image Size",
value="Default"
)
num_inference_steps = gr.Slider(minimum=1, maximum=50, step=1, label="Num Inference Steps", value=28)
seed = gr.Textbox(label="Seed", placeholder="random", value="random")
guidance_scale = gr.Slider(minimum=0.1, maximum=10.0, step=0.1, label="Guidance Scale (CFG)", value=3.5)
sync_mode = gr.Checkbox(label="Sync Mode", value=True)
num_images = gr.Slider(minimum=1, maximum=10, step=1, label="Number of Images", value=1)
generate_btn = gr.Button("Generate Image")
with gr.Column():
# Output component
output_image = gr.Image(label="Generated Image")
# Set up the click event for generating the image
generate_btn.click(
fn=generate_image,
inputs=[prompt, image_size, num_inference_steps, seed, guidance_scale, sync_mode, num_images],
outputs=output_image
)
demo.launch()