silveroxides commited on
Commit
371ea68
1 Parent(s): fd40cc4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -4,11 +4,11 @@ import random
4
 
5
  import spaces
6
  from diffusers import DiffusionPipeline
7
- from transformers import T5EncoderModel, CLIPTextModel
8
  import torch
9
 
10
  device = "cuda" if torch.cuda.is_available() else "cpu"
11
- text_encoder_repo = "silveroxides/diffusers-long-clip"
12
  text_encoder_3_repo = "silveroxides/t5xxl_flan_enc"
13
  model_repo_id = "stabilityai/stable-diffusion-3.5-large-turbo"
14
 
@@ -16,7 +16,7 @@ if torch.cuda.is_available():
16
  torch_dtype = torch.bfloat16
17
  else:
18
  torch_dtype = torch.float32
19
- text_encoder = CLIPTextModel.from_pretrained(text_encoder_repo, torch_dtype=torch_dtype)
20
  text_encoder_3 = T5EncoderModel.from_pretrained(text_encoder_3_repo, torch_dtype=torch_dtype)
21
  pipe = DiffusionPipeline.from_pretrained(model_repo_id, text_encoder=text_encoder, text_encoder_3=text_encoder_3, torch_dtype=torch_dtype)
22
  pipe = pipe.to(device)
 
4
 
5
  import spaces
6
  from diffusers import DiffusionPipeline
7
+ from transformers import T5EncoderModel, CLIPTextModelWithProjection
8
  import torch
9
 
10
  device = "cuda" if torch.cuda.is_available() else "cpu"
11
+ text_encoder_repo = "silveroxides/CLIP_L_Fur"
12
  text_encoder_3_repo = "silveroxides/t5xxl_flan_enc"
13
  model_repo_id = "stabilityai/stable-diffusion-3.5-large-turbo"
14
 
 
16
  torch_dtype = torch.bfloat16
17
  else:
18
  torch_dtype = torch.float32
19
+ text_encoder = CLIPTextModelWithProjection.from_pretrained(text_encoder_repo, torch_dtype=torch_dtype)
20
  text_encoder_3 = T5EncoderModel.from_pretrained(text_encoder_3_repo, torch_dtype=torch_dtype)
21
  pipe = DiffusionPipeline.from_pretrained(model_repo_id, text_encoder=text_encoder, text_encoder_3=text_encoder_3, torch_dtype=torch_dtype)
22
  pipe = pipe.to(device)