colt12 commited on
Commit
da36afd
·
verified ·
1 Parent(s): b69da0c

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +5 -2
handler.py CHANGED
@@ -7,8 +7,11 @@ class InferenceHandler:
7
  def __init__(self):
8
  self.device = "cuda" if torch.cuda.is_available() else "cpu"
9
  model_name = "colt12/maxcushion"
10
- self.pipe = StableDiffusionXLPipeline.from_pretrained(model_name, torch_dtype=torch.float16, use_safetensors=True, variant="fp16")
11
- self.pipe = self.pipe.to(self.device)
 
 
 
12
 
13
  def __call__(self, inputs):
14
  prompt = inputs.get("prompt", "")
 
7
  def __init__(self):
8
  self.device = "cuda" if torch.cuda.is_available() else "cpu"
9
  model_name = "colt12/maxcushion"
10
+ self.pipe = StableDiffusionXLPipeline.from_pretrained(
11
+ model_name,
12
+ torch_dtype=torch.float16,
13
+ use_safetensors=True
14
+ ).to(self.device) # Moved to the device here
15
 
16
  def __call__(self, inputs):
17
  prompt = inputs.get("prompt", "")