Spaces:
Runtime error
Runtime error
inpaint
Browse files
app.py
CHANGED
@@ -26,10 +26,10 @@ base_model = "black-forest-labs/FLUX.1-dev"
|
|
26 |
controlnet_model = "InstantX/FLUX.1-dev-Controlnet-Canny"
|
27 |
|
28 |
controlnet = FluxControlNetModel.from_pretrained(controlnet_model, torch_dtype=dtype)
|
29 |
-
pipe = FluxControlNetInpaintPipeline.from_pretrained(
|
30 |
-
|
31 |
-
).to(device)
|
32 |
-
|
33 |
|
34 |
pipe.enable_model_cpu_offload()
|
35 |
|
@@ -93,10 +93,9 @@ def inpaint(
|
|
93 |
resized_mask = mask.resize((width, height), Image.LANCZOS)
|
94 |
|
95 |
image_res = pipe(
|
96 |
-
prompt
|
97 |
-
prompt_2="red l-shaped sofa, red stripes, sleeping cat.",
|
98 |
image=resized_image,
|
99 |
-
control_image=canny_image,
|
100 |
mask_image=resized_mask,
|
101 |
strength=strength,
|
102 |
num_inference_steps=num_inference_steps,
|
|
|
26 |
controlnet_model = "InstantX/FLUX.1-dev-Controlnet-Canny"
|
27 |
|
28 |
controlnet = FluxControlNetModel.from_pretrained(controlnet_model, torch_dtype=dtype)
|
29 |
+
# pipe = FluxControlNetInpaintPipeline.from_pretrained(
|
30 |
+
# base_model, controlnet=controlnet, torch_dtype=dtype
|
31 |
+
# ).to(device)
|
32 |
+
pipe = FluxInpaintPipeline.from_pretrained(base_model, torch_dtype=dtype).to(device)
|
33 |
|
34 |
pipe.enable_model_cpu_offload()
|
35 |
|
|
|
93 |
resized_mask = mask.resize((width, height), Image.LANCZOS)
|
94 |
|
95 |
image_res = pipe(
|
96 |
+
prompt,
|
|
|
97 |
image=resized_image,
|
98 |
+
# control_image=canny_image,
|
99 |
mask_image=resized_mask,
|
100 |
strength=strength,
|
101 |
num_inference_steps=num_inference_steps,
|