Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import torch
|
|
| 2 |
import spaces
|
| 3 |
import gradio as gr
|
| 4 |
from diffusers import DiffusionPipeline
|
| 5 |
-
|
| 6 |
import spaces
|
| 7 |
from dataclasses import dataclass
|
| 8 |
import json
|
|
@@ -25,21 +25,7 @@ pipe = DiffusionPipeline.from_pretrained(
|
|
| 25 |
)
|
| 26 |
|
| 27 |
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
# if enable_compile:
|
| 31 |
-
# print("Compiling transformer...")
|
| 32 |
-
# pipe.transformer = torch.compile(pipe.transformer, mode="max-autotune-no-cudagraphs", fullgraph=False)
|
| 33 |
-
|
| 34 |
-
pipe.to("cuda")
|
| 35 |
-
|
| 36 |
-
optimize_pipeline_(
|
| 37 |
-
pipe,
|
| 38 |
-
prompt="prompt",
|
| 39 |
-
num_inference_steps=1,
|
| 40 |
-
guidance_scale=0.0
|
| 41 |
-
)
|
| 42 |
-
|
| 43 |
|
| 44 |
@spaces.GPU
|
| 45 |
def generate_image(prompt, height, width, num_inference_steps, seed, randomize_seed):
|
|
|
|
| 2 |
import spaces
|
| 3 |
import gradio as gr
|
| 4 |
from diffusers import DiffusionPipeline
|
| 5 |
+
|
| 6 |
import spaces
|
| 7 |
from dataclasses import dataclass
|
| 8 |
import json
|
|
|
|
| 25 |
)
|
| 26 |
|
| 27 |
|
| 28 |
+
pipe.transformer.layers._repeated_blocks = ["ZImageTransformerBlock"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
@spaces.GPU
|
| 31 |
def generate_image(prompt, height, width, num_inference_steps, seed, randomize_seed):
|