prokofyev8 commited on
Commit
8c2e3d4
·
verified ·
1 Parent(s): c73e6ed

using model "GuangyuanSD/Z-Image-Re-Turbo-LoRA"

Browse files
Files changed (1) hide show
  1. app.py +2 -11
app.py CHANGED
@@ -6,22 +6,13 @@ import random
6
  from diffusers import DiffusionPipeline
7
  import torch
8
 
9
- device = "cuda" if torch.cuda.is_available() else "cpu"
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
- # @spaces.GPU #[uncomment to use ZeroGPU]
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,