Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ def initialize_auraflow_pipeline():
|
|
12 |
).to("cuda")
|
13 |
return pipeline
|
14 |
|
15 |
-
@spaces.GPU(duration=
|
16 |
def generate_image(pipeline, prompt, width, height, num_inference_steps, seed, guidance_scale):
|
17 |
"""Generate an image using the AuraFlowPipeline."""
|
18 |
generator = torch.Generator().manual_seed(seed)
|
@@ -36,7 +36,7 @@ def gradio_generate_image(prompt, width, height, num_inference_steps, seed, guid
|
|
36 |
return generate_image(auraflow_pipeline, prompt, width, height, num_inference_steps, seed, guidance_scale)
|
37 |
|
38 |
# Create Gradio Blocks
|
39 |
-
with gr.Blocks() as demo:
|
40 |
gr.HTML(
|
41 |
"""
|
42 |
<h1 style='text-align: center'>
|
@@ -53,8 +53,8 @@ with gr.Blocks() as demo:
|
|
53 |
with gr.Row():
|
54 |
with gr.Column():
|
55 |
prompt_input = gr.Textbox(label="Prompt", placeholder="Enter your image prompt here...")
|
56 |
-
width_input = gr.Slider(minimum=256, maximum=
|
57 |
-
height_input = gr.Slider(minimum=256, maximum=
|
58 |
steps_input = gr.Slider(minimum=10, maximum=100, step=1, value=20, label="Number of Inference Steps")
|
59 |
seed_input = gr.Number(label="Seed", value=1)
|
60 |
guidance_input = gr.Slider(minimum=1, maximum=10, step=0.1, value=3.5, label="Guidance Scale")
|
|
|
12 |
).to("cuda")
|
13 |
return pipeline
|
14 |
|
15 |
+
@spaces.GPU(duration=120)
|
16 |
def generate_image(pipeline, prompt, width, height, num_inference_steps, seed, guidance_scale):
|
17 |
"""Generate an image using the AuraFlowPipeline."""
|
18 |
generator = torch.Generator().manual_seed(seed)
|
|
|
36 |
return generate_image(auraflow_pipeline, prompt, width, height, num_inference_steps, seed, guidance_scale)
|
37 |
|
38 |
# Create Gradio Blocks
|
39 |
+
with gr.Blocks(theme="bethecloud/storj_theme") as demo:
|
40 |
gr.HTML(
|
41 |
"""
|
42 |
<h1 style='text-align: center'>
|
|
|
53 |
with gr.Row():
|
54 |
with gr.Column():
|
55 |
prompt_input = gr.Textbox(label="Prompt", placeholder="Enter your image prompt here...")
|
56 |
+
width_input = gr.Slider(minimum=256, maximum=1536, step=64, value=1024, label="Width")
|
57 |
+
height_input = gr.Slider(minimum=256, maximum=1536, step=64, value=1024, label="Height")
|
58 |
steps_input = gr.Slider(minimum=10, maximum=100, step=1, value=20, label="Number of Inference Steps")
|
59 |
seed_input = gr.Number(label="Seed", value=1)
|
60 |
guidance_input = gr.Slider(minimum=1, maximum=10, step=0.1, value=3.5, label="Guidance Scale")
|