yamildiego commited on
Commit
3efa11b
·
1 Parent(s): b81ee75

no control net

Browse files
Files changed (1) hide show
  1. handler.py +6 -7
handler.py CHANGED
@@ -92,12 +92,12 @@ class EndpointHandler():
92
  return {"error": "Please provide a prompt and base64 encoded image."}
93
 
94
  # Check if a new controlnet is provided
95
- if controlnet_type is not None and controlnet_type != self.control_type:
96
- print(f"changing controlnet from {self.control_type} to {controlnet_type} using {CONTROLNET_MAPPING[controlnet_type]['model_id']} model")
97
- self.control_type = controlnet_type
98
- self.controlnet = ControlNetModel.from_pretrained(CONTROLNET_MAPPING[self.control_type]["model_id"],
99
- torch_dtype=dtype).to(device)
100
- self.pipe.controlnet = self.controlnet
101
 
102
 
103
  targets = [self.pipe.vae, self.pipe.unet]
@@ -107,7 +107,6 @@ class EndpointHandler():
107
  module.padding_mode = "circular"
108
 
109
  # hyperparamters
110
- negatice_prompt = data.pop("negative_prompt", None)
111
  num_inference_steps = data.pop("num_inference_steps", 30)
112
  guidance_scale = data.pop("guidance_scale", 7.4)
113
  negative_prompt = data.pop("negative_prompt", None)
 
92
  return {"error": "Please provide a prompt and base64 encoded image."}
93
 
94
  # Check if a new controlnet is provided
95
+ #if controlnet_type is not None and controlnet_type != self.control_type:
96
+ # print(f"changing controlnet from {self.control_type} to {controlnet_type} using {CONTROLNET_MAPPING[controlnet_type]['model_id']} model")
97
+ # self.control_type = controlnet_type
98
+ # self.controlnet = ControlNetModel.from_pretrained(CONTROLNET_MAPPING[self.control_type]["model_id"],
99
+ # torch_dtype=dtype).to(device)
100
+ # self.pipe.controlnet = self.controlnet
101
 
102
 
103
  targets = [self.pipe.vae, self.pipe.unet]
 
107
  module.padding_mode = "circular"
108
 
109
  # hyperparamters
 
110
  num_inference_steps = data.pop("num_inference_steps", 30)
111
  guidance_scale = data.pop("guidance_scale", 7.4)
112
  negative_prompt = data.pop("negative_prompt", None)