Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,3 @@
|
|
1 |
-
# This space used model: stabilityai/stable-diffusion-xl-base-1.0
|
2 |
-
# and model: stabilityai/stable-diffusion-xl-refiner-1.0
|
3 |
-
|
4 |
-
|
5 |
import numpy as np
|
6 |
import gradio as gr
|
7 |
import requests
|
@@ -171,33 +167,30 @@ with gr.Blocks(css=css) as demo:
|
|
171 |
<rect x="23" y="69" width="23" height="23" fill="black"></rect>
|
172 |
</svg>
|
173 |
<h1 style="font-weight: 900; margin-bottom: 7px;margin-top:5px">
|
174 |
-
|
175 |
</h1>
|
176 |
</div>
|
177 |
</div>
|
178 |
""")
|
179 |
-
with gr.Row(elem_id="prompt-container").style(mobile_collapse=False, equal_height=True):
|
180 |
-
|
181 |
-
|
182 |
-
|
|
|
|
|
183 |
with gr.Column(scale=1):
|
184 |
image_output = gr.Image(elem_id="gallery")
|
185 |
with gr.Row():
|
186 |
-
with gr.Accordion("
|
187 |
-
with gr.Column(scale=1):
|
188 |
-
negative_prompt = gr.Textbox(label="Negative Prompt", value="text, blurry", placeholder="What you don't want to see in the image", show_label=True, lines=1, elem_id="negative-prompt-text-input")
|
189 |
with gr.Column(scale=1):
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
|
201 |
text_button.click(flip_text, inputs=[prompt, negative_prompt, steps, cfg_scale, width, height, seed], outputs=image_output)
|
|
|
202 |
|
203 |
demo.queue(concurrency_count=16, max_size=20, api_open=False).launch(max_threads=64)
|
|
|
|
|
|
|
|
|
|
|
1 |
import numpy as np
|
2 |
import gradio as gr
|
3 |
import requests
|
|
|
167 |
<rect x="23" y="69" width="23" height="23" fill="black"></rect>
|
168 |
</svg>
|
169 |
<h1 style="font-weight: 900; margin-bottom: 7px;margin-top:5px">
|
170 |
+
Disney AI Pixar Poster Generator
|
171 |
</h1>
|
172 |
</div>
|
173 |
</div>
|
174 |
""")
|
175 |
+
with gr.Row(elem_id="prompt-container").style(mobile_collapse=False, equal_height=True):
|
176 |
+
with gr.Column(scale=3):
|
177 |
+
prompt = gr.Textbox(label="Prompt", placeholder="Make a disney Pixar Style cute cat 8k", show_label=True, lines=1, elem_id="prompt-text-input")
|
178 |
+
with gr.Column(scale=1):
|
179 |
+
text_button = gr.Button("Generate", variant='primary', elem_id="gen-button")
|
180 |
+
with gr.Row():
|
181 |
with gr.Column(scale=1):
|
182 |
image_output = gr.Image(elem_id="gallery")
|
183 |
with gr.Row():
|
184 |
+
with gr.Accordion("Additional inputs", open=False):
|
|
|
|
|
185 |
with gr.Column(scale=1):
|
186 |
+
width = gr.Slider(label="↔️ Width", minimum=512, maximum=1024, value=1024, step=8)
|
187 |
+
height = gr.Slider(label="↕️ Height", minimum=512, maximum=1024, value=1024, step=8)
|
188 |
+
negative_prompt = gr.Textbox(label="Negative Prompt", value="blurry, black and white, (deformed head, eyes, ears, mouth)", placeholder="What you don't want to see in the image", show_label=True, lines=1, elem_id="negative-prompt-text-input")
|
189 |
+
steps = gr.Slider(label="Sampling Steps (higher value means more details)", minimum=1, maximum=30, value=25, step=1)
|
190 |
+
cfg_scale = gr.Slider(label="CFG Scale (higher value means more closely following the prompt)", minimum=1, maximum=20, value=7, step=1)
|
191 |
+
seed = gr.Number(label="Seed (use -1 for random)", value=-1)
|
|
|
|
|
|
|
|
|
192 |
|
193 |
text_button.click(flip_text, inputs=[prompt, negative_prompt, steps, cfg_scale, width, height, seed], outputs=image_output)
|
194 |
+
text_button.click(lambda: gr.update(label="Your Image will be ready in few seconds"), outputs=text_button)
|
195 |
|
196 |
demo.queue(concurrency_count=16, max_size=20, api_open=False).launch(max_threads=64)
|