Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,17 +4,18 @@ import random
|
|
4 |
|
5 |
import spaces
|
6 |
from diffusers import DiffusionPipeline
|
|
|
7 |
import torch
|
8 |
|
9 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
10 |
-
|
11 |
model_repo_id = "stabilityai/stable-diffusion-3.5-large-turbo"
|
12 |
|
13 |
if torch.cuda.is_available():
|
14 |
torch_dtype = torch.bfloat16
|
15 |
else:
|
16 |
torch_dtype = torch.float32
|
17 |
-
|
18 |
pipe = DiffusionPipeline.from_pretrained(model_repo_id, text_encoder_3=text_encoder_3, torch_dtype=torch_dtype)
|
19 |
pipe = pipe.to(device)
|
20 |
|
|
|
4 |
|
5 |
import spaces
|
6 |
from diffusers import DiffusionPipeline
|
7 |
+
from transformers import T5EncoderModel
|
8 |
import torch
|
9 |
|
10 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
11 |
+
text_encoder_3_repo = "silveroxides/t5xxl_flan_enc"
|
12 |
model_repo_id = "stabilityai/stable-diffusion-3.5-large-turbo"
|
13 |
|
14 |
if torch.cuda.is_available():
|
15 |
torch_dtype = torch.bfloat16
|
16 |
else:
|
17 |
torch_dtype = torch.float32
|
18 |
+
text_encoder_3 = T5EncoderModel.from_pretrained(text_encoder_3_repo, torch_dtype=torch_dtype)
|
19 |
pipe = DiffusionPipeline.from_pretrained(model_repo_id, text_encoder_3=text_encoder_3, torch_dtype=torch_dtype)
|
20 |
pipe = pipe.to(device)
|
21 |
|