Spaces:
Runtime error
Runtime error
using model "GuangyuanSD/Z-Image-Re-Turbo-LoRA"
Browse files
app.py
CHANGED
|
@@ -6,22 +6,13 @@ import random
|
|
| 6 |
from diffusers import DiffusionPipeline
|
| 7 |
import torch
|
| 8 |
|
| 9 |
-
|
| 10 |
-
model_repo_id = "stabilityai/sdxl-turbo" # Replace to the model you would like to use
|
| 11 |
-
|
| 12 |
-
if torch.cuda.is_available():
|
| 13 |
-
torch_dtype = torch.float16
|
| 14 |
-
else:
|
| 15 |
-
torch_dtype = torch.float32
|
| 16 |
-
|
| 17 |
-
pipe = DiffusionPipeline.from_pretrained(model_repo_id, torch_dtype=torch_dtype)
|
| 18 |
-
pipe = pipe.to(device)
|
| 19 |
|
| 20 |
MAX_SEED = np.iinfo(np.int32).max
|
| 21 |
MAX_IMAGE_SIZE = 1024
|
| 22 |
|
| 23 |
|
| 24 |
-
|
| 25 |
def infer(
|
| 26 |
prompt,
|
| 27 |
negative_prompt,
|
|
|
|
| 6 |
from diffusers import DiffusionPipeline
|
| 7 |
import torch
|
| 8 |
|
| 9 |
+
pipe = DiffusionPipeline.from_pretrained("GuangyuanSD/Z-Image-Re-Turbo-LoRA", dtype=torch.bfloat16, device_map="cuda")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
MAX_SEED = np.iinfo(np.int32).max
|
| 12 |
MAX_IMAGE_SIZE = 1024
|
| 13 |
|
| 14 |
|
| 15 |
+
@spaces.GPU
|
| 16 |
def infer(
|
| 17 |
prompt,
|
| 18 |
negative_prompt,
|