Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ pipe = DiffusionPipeline.from_pretrained(model_id)
|
|
| 10 |
pipe = pipe.to("cpu") # Force CPU usage
|
| 11 |
|
| 12 |
# 3. FASTER GENERATION SETTINGS
|
| 13 |
-
def generate_image(prompt, negative_prompt="", steps=
|
| 14 |
return pipe(
|
| 15 |
prompt=prompt,
|
| 16 |
negative_prompt=negative_prompt,
|
|
@@ -20,13 +20,13 @@ def generate_image(prompt, negative_prompt="", steps=15):
|
|
| 20 |
|
| 21 |
# 4. STREAMLINED UI
|
| 22 |
with gr.Blocks() as demo:
|
| 23 |
-
gr.Markdown("#
|
| 24 |
|
| 25 |
with gr.Row():
|
| 26 |
with gr.Column():
|
| 27 |
-
prompt = gr.Textbox(label="Your Prompt", value="a
|
| 28 |
-
negative = gr.Textbox(label="Avoid (Optional)", value="
|
| 29 |
-
steps = gr.Slider(1, 30, value=
|
| 30 |
btn = gr.Button("Generate →")
|
| 31 |
|
| 32 |
output = gr.Image(label="Result", height=400)
|
|
@@ -35,8 +35,8 @@ with gr.Blocks() as demo:
|
|
| 35 |
|
| 36 |
gr.Examples(
|
| 37 |
examples=[
|
| 38 |
-
["
|
| 39 |
-
["watercolor painting of a
|
| 40 |
],
|
| 41 |
inputs=[prompt, negative, steps]
|
| 42 |
)
|
|
|
|
| 10 |
pipe = pipe.to("cpu") # Force CPU usage
|
| 11 |
|
| 12 |
# 3. FASTER GENERATION SETTINGS
|
| 13 |
+
def generate_image(prompt, negative_prompt="", steps=13):
|
| 14 |
return pipe(
|
| 15 |
prompt=prompt,
|
| 16 |
negative_prompt=negative_prompt,
|
|
|
|
| 20 |
|
| 21 |
# 4. STREAMLINED UI
|
| 22 |
with gr.Blocks() as demo:
|
| 23 |
+
gr.Markdown("# Fast AI Image Generator using OFA Small")
|
| 24 |
|
| 25 |
with gr.Row():
|
| 26 |
with gr.Column():
|
| 27 |
+
prompt = gr.Textbox(label="Your Prompt", value="a beautiful flower")
|
| 28 |
+
negative = gr.Textbox(label="Avoid (Optional)", value="low-resolution")
|
| 29 |
+
steps = gr.Slider(1, 30, value=13, label="Quality Steps")
|
| 30 |
btn = gr.Button("Generate →")
|
| 31 |
|
| 32 |
output = gr.Image(label="Result", height=400)
|
|
|
|
| 35 |
|
| 36 |
gr.Examples(
|
| 37 |
examples=[
|
| 38 |
+
["cityscape at night, red lights", "people", 12],
|
| 39 |
+
["watercolor painting of a flower", "photorealistic", 8]
|
| 40 |
],
|
| 41 |
inputs=[prompt, negative, steps]
|
| 42 |
)
|