Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ from datetime import datetime
|
|
14 |
|
15 |
DESCRIPTION = """ # Instant Image
|
16 |
### Super fast text to Image Generator.
|
17 |
-
### <span style='color: red;'>You may change the steps from
|
18 |
### First Image processing takes time then images generate faster.
|
19 |
"""
|
20 |
if not torch.cuda.is_available():
|
@@ -51,11 +51,6 @@ style_list = [
|
|
51 |
"prompt": "anime artwork {prompt} . anime style, key visual, vibrant, studio anime, highly detailed",
|
52 |
"negative_prompt": "photo, deformed, black and white, realism, disfigured, low contrast",
|
53 |
},
|
54 |
-
{
|
55 |
-
"name": "Manga",
|
56 |
-
"prompt": "manga style {prompt} . vibrant, high-energy, detailed, iconic, Japanese comic style",
|
57 |
-
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, Western comic style",
|
58 |
-
},
|
59 |
{
|
60 |
"name": "Digital Art",
|
61 |
"prompt": "concept art {prompt} . digital artwork, illustrative, painterly, matte painting, highly detailed",
|
@@ -71,11 +66,6 @@ style_list = [
|
|
71 |
"prompt": "ethereal fantasy concept art of {prompt} . magnificent, celestial, ethereal, painterly, epic, majestic, magical, fantasy art, cover art, dreamy",
|
72 |
"negative_prompt": "photographic, realistic, realism, 35mm film, dslr, cropped, frame, text, deformed, glitch, noise, noisy, off-center, deformed, cross-eyed, closed eyes, bad anatomy, ugly, disfigured, sloppy, duplicate, mutated, black and white",
|
73 |
},
|
74 |
-
{
|
75 |
-
"name": "Neonpunk",
|
76 |
-
"prompt": "neonpunk style {prompt} . cyberpunk, vaporwave, neon, vibes, vibrant, stunningly beautiful, crisp, detailed, sleek, ultramodern, magenta highlights, dark purple shadows, high contrast, cinematic, ultra detailed, intricate, professional",
|
77 |
-
"negative_prompt": "painting, drawing, illustration, glitch, deformed, mutated, cross-eyed, ugly, disfigured",
|
78 |
-
},
|
79 |
{
|
80 |
"name": "3D Model",
|
81 |
"prompt": "professional 3d model {prompt} . octane render, highly detailed, volumetric, dramatic lighting",
|
@@ -132,9 +122,6 @@ def randomize_seed_fn(seed: int, randomize_seed: bool) -> int:
|
|
132 |
seed = random.randint(0, MAX_SEED)
|
133 |
return seed
|
134 |
|
135 |
-
|
136 |
-
@torch.no_grad()
|
137 |
-
@torch.inference_mode()
|
138 |
@spaces.GPU(duration=30)
|
139 |
def generate(
|
140 |
prompt: str,
|
@@ -176,24 +163,15 @@ def generate(
|
|
176 |
|
177 |
examples = [
|
178 |
"A Monkey with a happy face in the Sahara desert.",
|
179 |
-
"Eiffel Tower was Made up of ICE
|
180 |
-
"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.",
|
181 |
"Color photo of a corgi made of transparent glass, standing on the riverside in Yosemite National Park.",
|
182 |
-
"A close-up photo of a woman. She wore a blue coat with a gray dress underneath
|
183 |
"A litter of golden retriever puppies playing in the snow. Their heads pop out of the snow, covered in.",
|
184 |
-
"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",
|
185 |
"an astronaut sitting in a diner, eating fries, cinematic, analog film",
|
186 |
-
"Pirate ship trapped in a cosmic maelstrom nebula, rendered in cosmic beach whirlpool engine, volumetric lighting, spectacular, ambient lights, intricate detail.",
|
187 |
-
"professional portrait photo of an anthropomorphic cat wearing fancy gentleman hat and jacket walking in autumn forest.",
|
188 |
]
|
189 |
|
190 |
with gr.Blocks() as demo:
|
191 |
gr.Markdown(DESCRIPTION)
|
192 |
-
gr.DuplicateButton(
|
193 |
-
value="Duplicate Space for private use",
|
194 |
-
elem_id="duplicate-button",
|
195 |
-
visible=os.getenv("SHOW_DUPLICATE_BUTTON") == "1",
|
196 |
-
)
|
197 |
with gr.Row(equal_height=False):
|
198 |
with gr.Group():
|
199 |
with gr.Row():
|
|
|
14 |
|
15 |
DESCRIPTION = """ # Instant Image
|
16 |
### Super fast text to Image Generator.
|
17 |
+
### <span style='color: red;'>You may change the steps from 4 to 8, if you didn't get satisfied results.
|
18 |
### First Image processing takes time then images generate faster.
|
19 |
"""
|
20 |
if not torch.cuda.is_available():
|
|
|
51 |
"prompt": "anime artwork {prompt} . anime style, key visual, vibrant, studio anime, highly detailed",
|
52 |
"negative_prompt": "photo, deformed, black and white, realism, disfigured, low contrast",
|
53 |
},
|
|
|
|
|
|
|
|
|
|
|
54 |
{
|
55 |
"name": "Digital Art",
|
56 |
"prompt": "concept art {prompt} . digital artwork, illustrative, painterly, matte painting, highly detailed",
|
|
|
66 |
"prompt": "ethereal fantasy concept art of {prompt} . magnificent, celestial, ethereal, painterly, epic, majestic, magical, fantasy art, cover art, dreamy",
|
67 |
"negative_prompt": "photographic, realistic, realism, 35mm film, dslr, cropped, frame, text, deformed, glitch, noise, noisy, off-center, deformed, cross-eyed, closed eyes, bad anatomy, ugly, disfigured, sloppy, duplicate, mutated, black and white",
|
68 |
},
|
|
|
|
|
|
|
|
|
|
|
69 |
{
|
70 |
"name": "3D Model",
|
71 |
"prompt": "professional 3d model {prompt} . octane render, highly detailed, volumetric, dramatic lighting",
|
|
|
122 |
seed = random.randint(0, MAX_SEED)
|
123 |
return seed
|
124 |
|
|
|
|
|
|
|
125 |
@spaces.GPU(duration=30)
|
126 |
def generate(
|
127 |
prompt: str,
|
|
|
163 |
|
164 |
examples = [
|
165 |
"A Monkey with a happy face in the Sahara desert.",
|
166 |
+
"Eiffel Tower was Made up of ICE.",
|
|
|
167 |
"Color photo of a corgi made of transparent glass, standing on the riverside in Yosemite National Park.",
|
168 |
+
"A close-up photo of a woman. She wore a blue coat with a gray dress underneath and has blue eyes.",
|
169 |
"A litter of golden retriever puppies playing in the snow. Their heads pop out of the snow, covered in.",
|
|
|
170 |
"an astronaut sitting in a diner, eating fries, cinematic, analog film",
|
|
|
|
|
171 |
]
|
172 |
|
173 |
with gr.Blocks() as demo:
|
174 |
gr.Markdown(DESCRIPTION)
|
|
|
|
|
|
|
|
|
|
|
175 |
with gr.Row(equal_height=False):
|
176 |
with gr.Group():
|
177 |
with gr.Row():
|