Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -287,9 +287,9 @@ if torch.cuda.is_available():
|
|
287 |
pipe2.unet = torch.compile(pipe2.unet, mode="reduce-overhead", fullgraph=True)
|
288 |
print("Model RealVisXL_V4.0 Compiled!")
|
289 |
|
290 |
-
# Load third model
|
291 |
pipe3 = StableDiffusionXLPipeline.from_pretrained(
|
292 |
-
"
|
293 |
torch_dtype=dtype,
|
294 |
use_safetensors=True,
|
295 |
add_watermarker=False,
|
@@ -320,7 +320,7 @@ else:
|
|
320 |
add_watermarker=False,
|
321 |
).to(device)
|
322 |
pipe3 = StableDiffusionXLPipeline.from_pretrained(
|
323 |
-
"
|
324 |
torch_dtype=dtype,
|
325 |
use_safetensors=True,
|
326 |
add_watermarker=False,
|
@@ -329,11 +329,11 @@ else:
|
|
329 |
|
330 |
# A dictionary to easily choose the model based on selection.
|
331 |
DEFAULT_MODEL = "Lightning 5"
|
332 |
-
MODEL_CHOICES = [DEFAULT_MODEL, "Lightning 4", "
|
333 |
models = {
|
334 |
"Lightning 5": pipe,
|
335 |
"Lightning 4": pipe2,
|
336 |
-
"
|
337 |
}
|
338 |
|
339 |
def save_image(img, path):
|
@@ -452,7 +452,7 @@ title = """<h1 align="center">IMAGINEO-4K : SDXL</h1>
|
|
452 |
<p><center>
|
453 |
<a href="https://huggingface.co/SG161222/RealVisXL_V4.0_Lightning" target="_blank">[Lightning 4]</a>
|
454 |
<a href="https://huggingface.co/SG161222/RealVisXL_V5.0_Lightning" target="_blank">[Lightning 5]</a>
|
455 |
-
<a href="https://huggingface.co/
|
456 |
</center></p>
|
457 |
"""
|
458 |
|
@@ -467,7 +467,7 @@ with gr.Blocks(css=css) as demo:
|
|
467 |
placeholder="Enter your prompt :/",
|
468 |
container=False,
|
469 |
)
|
470 |
-
run_button = gr.Button("Generate Image as ( 1024 x 1024 )
|
471 |
|
472 |
with gr.Row(visible=True):
|
473 |
model_selection = gr.Dropdown(
|
|
|
287 |
pipe2.unet = torch.compile(pipe2.unet, mode="reduce-overhead", fullgraph=True)
|
288 |
print("Model RealVisXL_V4.0 Compiled!")
|
289 |
|
290 |
+
# Load third model
|
291 |
pipe3 = StableDiffusionXLPipeline.from_pretrained(
|
292 |
+
"SG161222/RealVisXL_V3.0_Turbo",
|
293 |
torch_dtype=dtype,
|
294 |
use_safetensors=True,
|
295 |
add_watermarker=False,
|
|
|
320 |
add_watermarker=False,
|
321 |
).to(device)
|
322 |
pipe3 = StableDiffusionXLPipeline.from_pretrained(
|
323 |
+
"SG161222/RealVisXL_V3.0_Turbo",
|
324 |
torch_dtype=dtype,
|
325 |
use_safetensors=True,
|
326 |
add_watermarker=False,
|
|
|
329 |
|
330 |
# A dictionary to easily choose the model based on selection.
|
331 |
DEFAULT_MODEL = "Lightning 5"
|
332 |
+
MODEL_CHOICES = [DEFAULT_MODEL, "Lightning 4", "Turbo v3"]
|
333 |
models = {
|
334 |
"Lightning 5": pipe,
|
335 |
"Lightning 4": pipe2,
|
336 |
+
"Turbo v3": pipe3
|
337 |
}
|
338 |
|
339 |
def save_image(img, path):
|
|
|
452 |
<p><center>
|
453 |
<a href="https://huggingface.co/SG161222/RealVisXL_V4.0_Lightning" target="_blank">[Lightning 4]</a>
|
454 |
<a href="https://huggingface.co/SG161222/RealVisXL_V5.0_Lightning" target="_blank">[Lightning 5]</a>
|
455 |
+
<a href="https://huggingface.co/SG161222/RealVisXL_V3.0_Turbo" target="_blank">[Turbo v3]</a>
|
456 |
</center></p>
|
457 |
"""
|
458 |
|
|
|
467 |
placeholder="Enter your prompt :/",
|
468 |
container=False,
|
469 |
)
|
470 |
+
run_button = gr.Button("Generate Image as ( 1024 x 1024 ) 🔥", scale=0, elem_classes="submit-btn")
|
471 |
|
472 |
with gr.Row(visible=True):
|
473 |
model_selection = gr.Dropdown(
|