hassanblend commited on
Commit
ec451ae
1 Parent(s): c525df0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -1,6 +1,7 @@
1
  from diffusers import StableDiffusionPipeline, StableDiffusionImg2ImgPipeline, DPMSolverMultistepScheduler
2
  import gradio as gr
3
  import torch
 
4
  from PIL import Image
5
 
6
  model_id = 'hassanblend/HassanBlend1.5'
@@ -19,10 +20,12 @@ scheduler = DPMSolverMultistepScheduler(
19
  lower_order_final=True,
20
  )
21
 
22
- pipe = StableDiffusionPipeline.from_pretrained(
23
- model_id,
24
- torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
25
- scheduler=scheduler)
 
 
26
 
27
  pipe_i2i = StableDiffusionImg2ImgPipeline.from_pretrained(
28
  model_id,
 
1
  from diffusers import StableDiffusionPipeline, StableDiffusionImg2ImgPipeline, DPMSolverMultistepScheduler
2
  import gradio as gr
3
  import torch
4
+ pipe = pipe.to("cuda")
5
  from PIL import Image
6
 
7
  model_id = 'hassanblend/HassanBlend1.5'
 
20
  lower_order_final=True,
21
  )
22
 
23
+ vae = diffusers.AutoencoderKL.from_pretrained("stabilityai/sd-vae-ft-mse", torch_dtype=torch.float16)
24
+ pipe = diffusers.StableDiffusionPipeline.from_pretrained(
25
+ "hassanblend/HassanBlend1.5.1.2",
26
+ torch_dtype=torch.float16,
27
+ vae=vae,
28
+ )
29
 
30
  pipe_i2i = StableDiffusionImg2ImgPipeline.from_pretrained(
31
  model_id,