Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -37,13 +37,11 @@ style_list = [
|
|
37 |
"prompt": "hyper-realistic 4K image of {prompt}. ultra-detailed, lifelike, high-resolution, sharp, vibrant colors, photorealistic",
|
38 |
"negative_prompt": "cartoonish, low resolution, blurry, simplistic, abstract, deformed, ugly",
|
39 |
},
|
40 |
-
|
41 |
{
|
42 |
"name": "(No style)",
|
43 |
"prompt": "{prompt}",
|
44 |
"negative_prompt": "",
|
45 |
},
|
46 |
-
|
47 |
]
|
48 |
|
49 |
styles = {k["name"]: (k["prompt"], k["negative_prompt"]) for k in style_list}
|
@@ -98,13 +96,11 @@ if torch.cuda.is_available():
|
|
98 |
pipe2.unet = torch.compile(pipe2.unet, mode="reduce-overhead", fullgraph=True)
|
99 |
print("Model Compiled!")
|
100 |
|
101 |
-
|
102 |
def save_image(img):
|
103 |
unique_name = str(uuid.uuid4()) + ".png"
|
104 |
img.save(unique_name)
|
105 |
return unique_name
|
106 |
|
107 |
-
|
108 |
def randomize_seed_fn(seed: int, randomize_seed: bool) -> int:
|
109 |
if randomize_seed:
|
110 |
seed = random.randint(0, MAX_SEED)
|
@@ -153,13 +149,11 @@ def generate(
|
|
153 |
image_paths = [save_image(img) for img in images]
|
154 |
return image_paths, seed
|
155 |
|
156 |
-
|
157 |
examples = [
|
158 |
"3d image, cute girl, in the style of Pixar --ar 1:2 --stylize 750, 4K resolution highlights, Sharp focus, octane render, ray tracing, Ultra-High-Definition, 8k, UHD, HDR, (Masterpiece:1.5), (best quality:1.5)",
|
159 |
"Silhouette of Hamburger standing in front of a, dark blue sky, a little saturated orange in the background sunset, night time, dark background, dark black hair, cinematic photography, cinematic lighting, dark theme, shattered camera lens, digital photography, 70mm, f2.8, lens aberration, grain, boke, double exposure, shaterred, color negative ",
|
160 |
"A silver grey cat wearing sunglasses and a tuxedo, as an agent in the movie The Matrix, in the style of a real photo --ar 43:31 --v 6.0 --style raw",
|
161 |
"A professional product photography of a (coffee cup, perfume bottle, hoodie) in front of a (vintage, modern) background --v 6.0 --style raw"
|
162 |
-
|
163 |
]
|
164 |
|
165 |
css = '''
|
|
|
37 |
"prompt": "hyper-realistic 4K image of {prompt}. ultra-detailed, lifelike, high-resolution, sharp, vibrant colors, photorealistic",
|
38 |
"negative_prompt": "cartoonish, low resolution, blurry, simplistic, abstract, deformed, ugly",
|
39 |
},
|
|
|
40 |
{
|
41 |
"name": "(No style)",
|
42 |
"prompt": "{prompt}",
|
43 |
"negative_prompt": "",
|
44 |
},
|
|
|
45 |
]
|
46 |
|
47 |
styles = {k["name"]: (k["prompt"], k["negative_prompt"]) for k in style_list}
|
|
|
96 |
pipe2.unet = torch.compile(pipe2.unet, mode="reduce-overhead", fullgraph=True)
|
97 |
print("Model Compiled!")
|
98 |
|
|
|
99 |
def save_image(img):
|
100 |
unique_name = str(uuid.uuid4()) + ".png"
|
101 |
img.save(unique_name)
|
102 |
return unique_name
|
103 |
|
|
|
104 |
def randomize_seed_fn(seed: int, randomize_seed: bool) -> int:
|
105 |
if randomize_seed:
|
106 |
seed = random.randint(0, MAX_SEED)
|
|
|
149 |
image_paths = [save_image(img) for img in images]
|
150 |
return image_paths, seed
|
151 |
|
|
|
152 |
examples = [
|
153 |
"3d image, cute girl, in the style of Pixar --ar 1:2 --stylize 750, 4K resolution highlights, Sharp focus, octane render, ray tracing, Ultra-High-Definition, 8k, UHD, HDR, (Masterpiece:1.5), (best quality:1.5)",
|
154 |
"Silhouette of Hamburger standing in front of a, dark blue sky, a little saturated orange in the background sunset, night time, dark background, dark black hair, cinematic photography, cinematic lighting, dark theme, shattered camera lens, digital photography, 70mm, f2.8, lens aberration, grain, boke, double exposure, shaterred, color negative ",
|
155 |
"A silver grey cat wearing sunglasses and a tuxedo, as an agent in the movie The Matrix, in the style of a real photo --ar 43:31 --v 6.0 --style raw",
|
156 |
"A professional product photography of a (coffee cup, perfume bottle, hoodie) in front of a (vintage, modern) background --v 6.0 --style raw"
|
|
|
157 |
]
|
158 |
|
159 |
css = '''
|