Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import os
|
| 2 |
import torch
|
|
|
|
| 3 |
import gradio as gr
|
| 4 |
from diffusers import DiffusionPipeline, EulerDiscreteScheduler
|
| 5 |
|
|
@@ -23,12 +24,12 @@ pipe = DiffusionPipeline.from_pretrained(
|
|
| 23 |
# KSampler → choose a scheduler (Euler is close to your Comfy euler/simple)
|
| 24 |
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config)
|
| 25 |
pipe.to(device)
|
| 26 |
-
|
| 27 |
|
| 28 |
# ---------------------------------------------------------------------
|
| 29 |
# Inference function (maps to CLIPTextEncode + EmptySD3LatentImage + KSampler + VAEDecode)
|
| 30 |
# ---------------------------------------------------------------------
|
| 31 |
-
@spaces.GPU
|
| 32 |
def generate_images(
|
| 33 |
positive: str,
|
| 34 |
negative: str,
|
|
|
|
| 1 |
import os
|
| 2 |
import torch
|
| 3 |
+
import spaces
|
| 4 |
import gradio as gr
|
| 5 |
from diffusers import DiffusionPipeline, EulerDiscreteScheduler
|
| 6 |
|
|
|
|
| 24 |
# KSampler → choose a scheduler (Euler is close to your Comfy euler/simple)
|
| 25 |
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config)
|
| 26 |
pipe.to(device)
|
| 27 |
+
spaces.aoti_blocks_load(pipe.transformer.layers, "zerogpu-aoti/Z-Image", variant="fa3")
|
| 28 |
|
| 29 |
# ---------------------------------------------------------------------
|
| 30 |
# Inference function (maps to CLIPTextEncode + EmptySD3LatentImage + KSampler + VAEDecode)
|
| 31 |
# ---------------------------------------------------------------------
|
| 32 |
+
@spaces.GPU
|
| 33 |
def generate_images(
|
| 34 |
positive: str,
|
| 35 |
negative: str,
|