hafsa000 commited on
Commit
498a316
1 Parent(s): e1ea0f2

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +4 -4
handler.py CHANGED
@@ -3,16 +3,16 @@ from PIL import Image
3
  from io import BytesIO
4
  import torch
5
  import base64
6
- from diffusers import StableDiffusionInstructPix2PixPipeline, EulerAncestralDiscreteScheduler
7
 
8
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
9
 
10
  class EndpointHandler():
11
  def __init__(self, path=""):
12
- model_id = "timbrooks/instruct-pix2pix"
13
- self.pipe = StableDiffusionInstructPix2PixPipeline.from_pretrained(model_id, torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32, safety_checker=None)
14
  self.pipe.to(device)
15
- self.pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(self.pipe.scheduler.config)
16
 
17
  def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
18
  """
 
3
  from io import BytesIO
4
  import torch
5
  import base64
6
+ from diffusers import StableDiffusionImg2ImgPipeline
7
 
8
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
9
 
10
  class EndpointHandler():
11
  def __init__(self, path=""):
12
+ model_id = "hafsa000/interior-design"
13
+ self.pipe = StableDiffusionImg2ImgPipeline.from_pretrained(model_id, torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32, safety_checker=None)
14
  self.pipe.to(device)
15
+ self.pipe.scheduler = PNDMScheduler.from_config(self.pipe.scheduler.config)
16
 
17
  def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
18
  """