Spaces:
Runtime error
Runtime error
Nikita Pavlichenko
commited on
Commit
·
208deab
1
Parent(s):
94d9602
Small fix
Browse files- app.py +4 -3
- requirements.txt +2 -1
app.py
CHANGED
@@ -20,20 +20,21 @@ def generate(text):
|
|
20 |
img = pipe(prompt=prompt, num_inference_steps=50).images[0]
|
21 |
return img, prompt
|
22 |
|
|
|
23 |
with gr.Blocks() as demo:
|
24 |
with gr.Column(variant="panel"):
|
25 |
with gr.Row(variant="compact"):
|
26 |
text = gr.Textbox(
|
27 |
-
label="Enter your image description",
|
28 |
show_label=False,
|
29 |
max_lines=1,
|
30 |
-
placeholder="Enter your
|
31 |
).style(
|
32 |
container=False,
|
33 |
)
|
34 |
btn = gr.Button("Generate image").style(full_width=False)
|
35 |
|
36 |
-
written_prompt = gr.outputs.Textbox(label="
|
37 |
gen_img = gr.outputs.Image(type="pil",
|
38 |
label="Generated image",
|
39 |
).style(object_fit="contain", height=512)
|
|
|
20 |
img = pipe(prompt=prompt, num_inference_steps=50).images[0]
|
21 |
return img, prompt
|
22 |
|
23 |
+
|
24 |
with gr.Blocks() as demo:
|
25 |
with gr.Column(variant="panel"):
|
26 |
with gr.Row(variant="compact"):
|
27 |
text = gr.Textbox(
|
28 |
+
label="Enter your image description, e.g., \"a cat\"",
|
29 |
show_label=False,
|
30 |
max_lines=1,
|
31 |
+
placeholder="Enter your image description, e.g., \"a cat\"",
|
32 |
).style(
|
33 |
container=False,
|
34 |
)
|
35 |
btn = gr.Button("Generate image").style(full_width=False)
|
36 |
|
37 |
+
written_prompt = gr.outputs.Textbox(label="AI-written prompt")
|
38 |
gen_img = gr.outputs.Image(type="pil",
|
39 |
label="Generated image",
|
40 |
).style(object_fit="contain", height=512)
|
requirements.txt
CHANGED
@@ -2,4 +2,5 @@ torch
|
|
2 |
numpy
|
3 |
transformers
|
4 |
Pillow
|
5 |
-
diffusers==0.12.1
|
|
|
|
2 |
numpy
|
3 |
transformers
|
4 |
Pillow
|
5 |
+
diffusers==0.12.1
|
6 |
+
accelerate
|