Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -48,9 +48,9 @@ style_list = [
|
|
48 |
"negative_prompt": "anime, cartoon, graphic, text, painting, crayon, graphite, abstract, glitch, deformed, mutated, ugly, disfigured",
|
49 |
},
|
50 |
{
|
51 |
-
"name": "
|
52 |
-
"prompt": "
|
53 |
-
"negative_prompt": "drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly",
|
54 |
},
|
55 |
{
|
56 |
"name": "Anime",
|
@@ -92,7 +92,7 @@ style_list = [
|
|
92 |
|
93 |
styles = {k["name"]: (k["prompt"], k["negative_prompt"]) for k in style_list}
|
94 |
STYLE_NAMES = list(styles.keys())
|
95 |
-
DEFAULT_STYLE_NAME = "
|
96 |
SCHEDULE_NAME = ["DPM-Solver", "SA-Solver"]
|
97 |
DEFAULT_SCHEDULE_NAME = "DPM-Solver"
|
98 |
NUM_IMAGES_PER_PROMPT = 1
|
@@ -165,12 +165,12 @@ def generate(
|
|
165 |
use_negative_prompt: bool = False,
|
166 |
num_imgs: int = 1,
|
167 |
seed: int = 0,
|
168 |
-
width: int =
|
169 |
-
height: int =
|
170 |
schedule: str = 'DPM-Solver',
|
171 |
-
dpms_guidance_scale: float =
|
172 |
sas_guidance_scale: float = 3,
|
173 |
-
dpms_inference_steps: int =
|
174 |
sas_inference_steps: int = 25,
|
175 |
randomize_seed: bool = False,
|
176 |
use_resolution_binning: bool = True,
|
@@ -216,17 +216,17 @@ def generate(
|
|
216 |
|
217 |
|
218 |
examples = [
|
219 |
-
"A
|
220 |
-
"Eiffel Tower was Made up of
|
221 |
-
"3D
|
222 |
"Color photo of a corgi made of transparent glass, standing on the riverside in Yosemite National Park.",
|
223 |
-
"A close-up photo of a
|
224 |
"A litter of golden retriever puppies playing in the snow. Their heads pop out of the snow, covered in.",
|
225 |
"a handsome young boy in the middle with sky color background wearing eye glasses, it's super detailed with anime style, it's a portrait with delicated eyes and nice looking face",
|
226 |
"an astronaut sitting in a diner, eating fries, cinematic, analog film",
|
227 |
-
"Pirate ship trapped in a cosmic maelstrom nebula, rendered in cosmic beach whirlpool engine, volumetric lighting, spectacular, ambient lights,
|
228 |
"professional portrait photo of an anthropomorphic cat wearing fancy gentleman hat and jacket walking in autumn forest.",
|
229 |
-
"
|
230 |
]
|
231 |
|
232 |
with gr.Blocks(css="style.css") as demo:
|
@@ -252,16 +252,6 @@ with gr.Blocks(css="style.css") as demo:
|
|
252 |
with gr.Group():
|
253 |
with gr.Row():
|
254 |
use_negative_prompt = gr.Checkbox(label="Use negative prompt", value=False, visible=True)
|
255 |
-
with gr.Row(visible=True):
|
256 |
-
schedule = gr.Radio(
|
257 |
-
show_label=True,
|
258 |
-
container=True,
|
259 |
-
interactive=True,
|
260 |
-
choices=SCHEDULE_NAME,
|
261 |
-
value=DEFAULT_SCHEDULE_NAME,
|
262 |
-
label="Sampler Schedule",
|
263 |
-
visible=True,
|
264 |
-
)
|
265 |
num_imgs = gr.Slider(
|
266 |
label="Num Images",
|
267 |
minimum=1,
|
@@ -297,44 +287,29 @@ with gr.Blocks(css="style.css") as demo:
|
|
297 |
minimum=256,
|
298 |
maximum=MAX_IMAGE_SIZE,
|
299 |
step=32,
|
300 |
-
value=
|
301 |
)
|
302 |
height = gr.Slider(
|
303 |
label="Height",
|
304 |
minimum=256,
|
305 |
maximum=MAX_IMAGE_SIZE,
|
306 |
step=32,
|
307 |
-
value=
|
308 |
)
|
309 |
with gr.Row():
|
310 |
dpms_guidance_scale = gr.Slider(
|
311 |
-
label="
|
312 |
-
minimum=
|
313 |
-
maximum=
|
314 |
step=0.1,
|
315 |
-
value=
|
316 |
)
|
317 |
dpms_inference_steps = gr.Slider(
|
318 |
-
label="
|
319 |
minimum=5,
|
320 |
-
maximum=
|
321 |
-
step=1,
|
322 |
-
value=14,
|
323 |
-
)
|
324 |
-
with gr.Row():
|
325 |
-
sas_guidance_scale = gr.Slider(
|
326 |
-
label="SA-Solver Guidance scale",
|
327 |
-
minimum=1,
|
328 |
-
maximum=10,
|
329 |
-
step=0.1,
|
330 |
-
value=3,
|
331 |
-
)
|
332 |
-
sas_inference_steps = gr.Slider(
|
333 |
-
label="SA-Solver inference steps",
|
334 |
-
minimum=10,
|
335 |
-
maximum=40,
|
336 |
step=1,
|
337 |
-
value=
|
338 |
)
|
339 |
|
340 |
gr.Examples(
|
|
|
48 |
"negative_prompt": "anime, cartoon, graphic, text, painting, crayon, graphite, abstract, glitch, deformed, mutated, ugly, disfigured",
|
49 |
},
|
50 |
{
|
51 |
+
"name": "Realistic",
|
52 |
+
"prompt": "Photorealistic {prompt} . Ulta-realistic, professional, 4k, highly detailed",
|
53 |
+
"negative_prompt": "drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly, disfigured",
|
54 |
},
|
55 |
{
|
56 |
"name": "Anime",
|
|
|
92 |
|
93 |
styles = {k["name"]: (k["prompt"], k["negative_prompt"]) for k in style_list}
|
94 |
STYLE_NAMES = list(styles.keys())
|
95 |
+
DEFAULT_STYLE_NAME = "Realistic"
|
96 |
SCHEDULE_NAME = ["DPM-Solver", "SA-Solver"]
|
97 |
DEFAULT_SCHEDULE_NAME = "DPM-Solver"
|
98 |
NUM_IMAGES_PER_PROMPT = 1
|
|
|
165 |
use_negative_prompt: bool = False,
|
166 |
num_imgs: int = 1,
|
167 |
seed: int = 0,
|
168 |
+
width: int = 400,
|
169 |
+
height: int = 400,
|
170 |
schedule: str = 'DPM-Solver',
|
171 |
+
dpms_guidance_scale: float = 3.5,
|
172 |
sas_guidance_scale: float = 3,
|
173 |
+
dpms_inference_steps: int = 9,
|
174 |
sas_inference_steps: int = 25,
|
175 |
randomize_seed: bool = False,
|
176 |
use_resolution_binning: bool = True,
|
|
|
216 |
|
217 |
|
218 |
examples = [
|
219 |
+
"A Monkey with a happy face in the Sahara desert.",
|
220 |
+
"Eiffel Tower was Made up of ICE to look like a cloud, with the bell tower at the top of the building.",
|
221 |
+
"3D small, round, fluffy creature with big, expressive eyes explores a vibrant, enchanted forest. The creature, a whimsical blend of a rabbit and a squirrel, has soft blue fur and a bushy, striped tail. It hops along a sparkling stream, its eyes wide with wonder. The forest is alive with magical elements: flowers that glow and change colors, trees with leaves in shades of purple and silver, and small floating lights that resemble fireflies. The creature stops to interact playfully with a group of tiny, fairy-like beings dancing around a mushroom ring. The creature looks up in awe at a large, glowing tree that seems to be the heart of the forest.",
|
222 |
"Color photo of a corgi made of transparent glass, standing on the riverside in Yosemite National Park.",
|
223 |
+
"A close-up photo of a woman. She wore a blue coat with a gray dress underneath. She has blue eyes and blond hair, and wears a pair of earrings. Behind are blurred city buildings and streets.",
|
224 |
"A litter of golden retriever puppies playing in the snow. Their heads pop out of the snow, covered in.",
|
225 |
"a handsome young boy in the middle with sky color background wearing eye glasses, it's super detailed with anime style, it's a portrait with delicated eyes and nice looking face",
|
226 |
"an astronaut sitting in a diner, eating fries, cinematic, analog film",
|
227 |
+
"Pirate ship trapped in a cosmic maelstrom nebula, rendered in cosmic beach whirlpool engine, volumetric lighting, spectacular, ambient lights, intricate detail.",
|
228 |
"professional portrait photo of an anthropomorphic cat wearing fancy gentleman hat and jacket walking in autumn forest.",
|
229 |
+
"Outside View from Hotel Made up of Chocolate in space.",
|
230 |
]
|
231 |
|
232 |
with gr.Blocks(css="style.css") as demo:
|
|
|
252 |
with gr.Group():
|
253 |
with gr.Row():
|
254 |
use_negative_prompt = gr.Checkbox(label="Use negative prompt", value=False, visible=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
255 |
num_imgs = gr.Slider(
|
256 |
label="Num Images",
|
257 |
minimum=1,
|
|
|
287 |
minimum=256,
|
288 |
maximum=MAX_IMAGE_SIZE,
|
289 |
step=32,
|
290 |
+
value=400,
|
291 |
)
|
292 |
height = gr.Slider(
|
293 |
label="Height",
|
294 |
minimum=256,
|
295 |
maximum=MAX_IMAGE_SIZE,
|
296 |
step=32,
|
297 |
+
value=400,
|
298 |
)
|
299 |
with gr.Row():
|
300 |
dpms_guidance_scale = gr.Slider(
|
301 |
+
label="Temprature",
|
302 |
+
minimum=3,
|
303 |
+
maximum=4,
|
304 |
step=0.1,
|
305 |
+
value=3.5,
|
306 |
)
|
307 |
dpms_inference_steps = gr.Slider(
|
308 |
+
label="Steps",
|
309 |
minimum=5,
|
310 |
+
maximum=25,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
311 |
step=1,
|
312 |
+
value=9,
|
313 |
)
|
314 |
|
315 |
gr.Examples(
|