randomani commited on
Commit
8877930
·
verified ·
1 Parent(s): 73cfd30

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -3
app.py CHANGED
@@ -7,15 +7,26 @@ 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
 
7
  import torch
8
 
9
  device = "cuda" if torch.cuda.is_available() else "cpu"
10
+ model_repo_id = "randomani/EmojiGEN" # 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
+ # Load Stable Diffusion XL Base1.0
18
+ pipe = DiffusionPipeline.from_pretrained(
19
+ "stabilityai/stable-diffusion-xl-base-1.0",
20
+ torch_dtype=torch.float16,
21
+ variant="fp16",
22
+ use_safetensors=True
23
+ ).to(device)
24
+
25
+ # Optional CPU offloading to save some GPU Memory
26
+ pipe.enable_model_cpu_offload()
27
+
28
+ # # Loading Trained DreamBooth LoRA Weights
29
+ pipe.load_lora_weights(model_repo_id)
30
 
31
  MAX_SEED = np.iinfo(np.int32).max
32
  MAX_IMAGE_SIZE = 1024