Anwar786 commited on
Commit
f11d5c7
1 Parent(s): a36b3bd

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +4 -3
handler.py CHANGED
@@ -61,7 +61,8 @@ class EndpointHandler():
61
  self.controlnet = ControlNetModel.from_pretrained(CONTROLNET_MAPPING[self.control_type]["model_id"],torch_dtype=dtype).to(device)
62
 
63
  # Load StableDiffusionControlNetPipeline
64
- self.stable_diffusion_id = "runwayml/stable-diffusion-v1-5"
 
65
  self.pipe = StableDiffusionControlNetPipeline.from_pretrained(self.stable_diffusion_id,
66
  controlnet=self.controlnet,
67
  torch_dtype=dtype,
@@ -94,11 +95,11 @@ class EndpointHandler():
94
  # hyperparamters
95
  negatice_prompt = data.pop("negative_prompt", None)
96
  num_inference_steps = data.pop("num_inference_steps", 30)
97
- guidance_scale = data.pop("guidance_scale", 7.5)
98
  negative_prompt = data.pop("negative_prompt", None)
99
  height = data.pop("height", None)
100
  width = data.pop("width", None)
101
- controlnet_conditioning_scale = data.pop("controlnet_conditioning_scale", 0.8)
102
 
103
  # process image
104
  image = self.decode_base64_image(image)
 
61
  self.controlnet = ControlNetModel.from_pretrained(CONTROLNET_MAPPING[self.control_type]["model_id"],torch_dtype=dtype).to(device)
62
 
63
  # Load StableDiffusionControlNetPipeline
64
+ self.stable_diffusion_id = "runwayml/v1-5-pruned-emaonly.safetensors
65
+ "
66
  self.pipe = StableDiffusionControlNetPipeline.from_pretrained(self.stable_diffusion_id,
67
  controlnet=self.controlnet,
68
  torch_dtype=dtype,
 
95
  # hyperparamters
96
  negatice_prompt = data.pop("negative_prompt", None)
97
  num_inference_steps = data.pop("num_inference_steps", 30)
98
+ guidance_scale = data.pop("guidance_scale", 7.0)
99
  negative_prompt = data.pop("negative_prompt", None)
100
  height = data.pop("height", None)
101
  width = data.pop("width", None)
102
+ controlnet_conditioning_scale = data.pop("controlnet_conditioning_scale", 0.7)
103
 
104
  # process image
105
  image = self.decode_base64_image(image)