Update handler.py
Browse files- handler.py +3 -3
handler.py
CHANGED
@@ -20,12 +20,12 @@ class EndpointHandler:
|
|
20 |
|
21 |
# Load model and pipeline
|
22 |
self.controlnet = FluxControlNetModel.from_pretrained(
|
23 |
-
model_dir, torch_dtype=torch.
|
24 |
)
|
25 |
self.pipe = FluxControlNetPipeline.from_pretrained(
|
26 |
"black-forest-labs/FLUX.1-dev",
|
27 |
controlnet=self.controlnet,
|
28 |
-
torch_dtype=torch.
|
29 |
use_auth_token=HF_TOKEN
|
30 |
)
|
31 |
self.pipe.to("cuda")
|
@@ -55,7 +55,7 @@ class EndpointHandler:
|
|
55 |
prompt=data.get("prompt", ""),
|
56 |
control_image=control_image,
|
57 |
controlnet_conditioning_scale=0.6,
|
58 |
-
num_inference_steps=
|
59 |
height=control_image.size[1],
|
60 |
width=control_image.size[0],
|
61 |
).images[0]
|
|
|
20 |
|
21 |
# Load model and pipeline
|
22 |
self.controlnet = FluxControlNetModel.from_pretrained(
|
23 |
+
model_dir, torch_dtype=torch.float16, use_auth_token=HF_TOKEN
|
24 |
)
|
25 |
self.pipe = FluxControlNetPipeline.from_pretrained(
|
26 |
"black-forest-labs/FLUX.1-dev",
|
27 |
controlnet=self.controlnet,
|
28 |
+
torch_dtype=torch.float16,
|
29 |
use_auth_token=HF_TOKEN
|
30 |
)
|
31 |
self.pipe.to("cuda")
|
|
|
55 |
prompt=data.get("prompt", ""),
|
56 |
control_image=control_image,
|
57 |
controlnet_conditioning_scale=0.6,
|
58 |
+
num_inference_steps=20,
|
59 |
height=control_image.size[1],
|
60 |
width=control_image.size[0],
|
61 |
).images[0]
|