Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -78,6 +78,7 @@ style_list = [
|
|
78 |
"prompt": "{prompt}",
|
79 |
"negative_prompt": "",
|
80 |
},
|
|
|
81 |
]
|
82 |
|
83 |
collage_style_list = [
|
@@ -142,6 +143,7 @@ collage_style_list = [
|
|
142 |
"prompt": "{prompt}",
|
143 |
"negative_prompt": "",
|
144 |
},
|
|
|
145 |
]
|
146 |
|
147 |
filters = {
|
@@ -220,7 +222,7 @@ USE_TORCH_COMPILE = os.getenv("USE_TORCH_COMPILE", "0") == "1"
|
|
220 |
ENABLE_CPU_OFFLOAD = os.getenv("ENABLE_CPU_OFFLOAD", "0") == "1"
|
221 |
|
222 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
223 |
-
|
224 |
if torch.cuda.is_available():
|
225 |
pipe = DiffusionPipeline.from_pretrained(
|
226 |
"SG161222/RealVisXL_V4.0",
|
@@ -242,7 +244,7 @@ if torch.cuda.is_available():
|
|
242 |
|
243 |
def save_image(img, path):
|
244 |
img.save(path)
|
245 |
-
|
246 |
def randomize_seed_fn(seed: int, randomize_seed: bool) -> int:
|
247 |
if randomize_seed:
|
248 |
seed = random.randint(0, MAX_SEED)
|
@@ -320,6 +322,7 @@ def generate(
|
|
320 |
return [unique_name], seed
|
321 |
|
322 |
examples = [
|
|
|
323 |
"Portrait of a beautiful woman in a hat, summer outfit, with freckles on her face, in a close up shot, with sunlight, outdoors, in soft light, with a beach background, looking at the camera, with high resolution photography, in the style of Hasselblad X2D50c --ar 85:128 --v 6.0 --style raw",
|
324 |
"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)",
|
325 |
"Cold coffee in a cup bokeh --ar 85:128 --v 6.0 --style raw5, 4K, Photo-Realistic",
|
@@ -327,12 +330,12 @@ examples = [
|
|
327 |
]
|
328 |
|
329 |
css = '''
|
330 |
-
.gradio-container{max-width:
|
331 |
h1{text-align:center}
|
332 |
'''
|
333 |
#with gr.Blocks(css=css, theme="bethecloud/storj_theme", js=js_func) as demo:
|
334 |
-
|
335 |
-
with gr.Blocks(css=css, theme="Nymbo/Alyx_Theme") as demo:
|
336 |
gr.Markdown(DESCRIPTION)
|
337 |
gr.DuplicateButton(
|
338 |
value="Duplicate Space for private use",
|
@@ -491,7 +494,7 @@ with gr.Blocks(css=css, theme="Nymbo/Alyx_Theme") as demo:
|
|
491 |
api_name="run",
|
492 |
)
|
493 |
|
494 |
-
gr.Markdown("⚠️ responsible for ensuring it meets appropriate ethical standards")
|
495 |
|
496 |
if __name__ == "__main__":
|
497 |
demo.queue(max_size=20).launch()
|
|
|
78 |
"prompt": "{prompt}",
|
79 |
"negative_prompt": "",
|
80 |
},
|
81 |
+
|
82 |
]
|
83 |
|
84 |
collage_style_list = [
|
|
|
143 |
"prompt": "{prompt}",
|
144 |
"negative_prompt": "",
|
145 |
},
|
146 |
+
|
147 |
]
|
148 |
|
149 |
filters = {
|
|
|
222 |
ENABLE_CPU_OFFLOAD = os.getenv("ENABLE_CPU_OFFLOAD", "0") == "1"
|
223 |
|
224 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
225 |
+
#Compile
|
226 |
if torch.cuda.is_available():
|
227 |
pipe = DiffusionPipeline.from_pretrained(
|
228 |
"SG161222/RealVisXL_V4.0",
|
|
|
244 |
|
245 |
def save_image(img, path):
|
246 |
img.save(path)
|
247 |
+
#seeding
|
248 |
def randomize_seed_fn(seed: int, randomize_seed: bool) -> int:
|
249 |
if randomize_seed:
|
250 |
seed = random.randint(0, MAX_SEED)
|
|
|
322 |
return [unique_name], seed
|
323 |
|
324 |
examples = [
|
325 |
+
|
326 |
"Portrait of a beautiful woman in a hat, summer outfit, with freckles on her face, in a close up shot, with sunlight, outdoors, in soft light, with a beach background, looking at the camera, with high resolution photography, in the style of Hasselblad X2D50c --ar 85:128 --v 6.0 --style raw",
|
327 |
"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)",
|
328 |
"Cold coffee in a cup bokeh --ar 85:128 --v 6.0 --style raw5, 4K, Photo-Realistic",
|
|
|
330 |
]
|
331 |
|
332 |
css = '''
|
333 |
+
.gradio-container{max-width: 640px !important}
|
334 |
h1{text-align:center}
|
335 |
'''
|
336 |
#with gr.Blocks(css=css, theme="bethecloud/storj_theme", js=js_func) as demo:
|
337 |
+
with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
|
338 |
+
#with gr.Blocks(css=css, theme="Nymbo/Alyx_Theme") as demo:
|
339 |
gr.Markdown(DESCRIPTION)
|
340 |
gr.DuplicateButton(
|
341 |
value="Duplicate Space for private use",
|
|
|
494 |
api_name="run",
|
495 |
)
|
496 |
|
497 |
+
#gr.Markdown("⚠️ responsible for ensuring it meets appropriate ethical standards")
|
498 |
|
499 |
if __name__ == "__main__":
|
500 |
demo.queue(max_size=20).launch()
|