Upload folder using huggingface_hub
Browse files
main/pipline_flux_fill_controlnet_Inpaint.py
CHANGED
|
@@ -1168,12 +1168,12 @@ class FluxControlNetFillInpaintPipeline(DiffusionPipeline, FluxLoraLoaderMixin,
|
|
| 1168 |
generator,
|
| 1169 |
)
|
| 1170 |
|
| 1171 |
-
|
| 1172 |
-
|
| 1173 |
-
|
| 1174 |
-
|
| 1175 |
-
|
| 1176 |
-
|
| 1177 |
batch_size,
|
| 1178 |
num_channels_latents,
|
| 1179 |
num_images_per_prompt,
|
|
@@ -1243,7 +1243,7 @@ class FluxControlNetFillInpaintPipeline(DiffusionPipeline, FluxLoraLoaderMixin,
|
|
| 1243 |
else:
|
| 1244 |
guidance = None
|
| 1245 |
|
| 1246 |
-
masked_image_latents_fill = torch.cat((
|
| 1247 |
latent_model_input = torch.cat([latents, masked_image_latents_fill], dim=2)
|
| 1248 |
|
| 1249 |
noise_pred = self.transformer(
|
|
|
|
| 1168 |
generator,
|
| 1169 |
)
|
| 1170 |
|
| 1171 |
+
mask_image_fill = self.mask_processor.preprocess(mask_image, height=height, width=width)
|
| 1172 |
+
masked_image_fill = init_image * (1 - mask_image_fill)
|
| 1173 |
+
masked_image_fill = masked_image_fill.to(dtype=self.vae.dtype, device=device)
|
| 1174 |
+
mask_fill, masked_latents_fill = self.prepare_mask_latents_fill(
|
| 1175 |
+
mask_image_fill,
|
| 1176 |
+
masked_image_fill,
|
| 1177 |
batch_size,
|
| 1178 |
num_channels_latents,
|
| 1179 |
num_images_per_prompt,
|
|
|
|
| 1243 |
else:
|
| 1244 |
guidance = None
|
| 1245 |
|
| 1246 |
+
masked_image_latents_fill = torch.cat((masked_latents_fill, mask_fill), dim=-1)
|
| 1247 |
latent_model_input = torch.cat([latents, masked_image_latents_fill], dim=2)
|
| 1248 |
|
| 1249 |
noise_pred = self.transformer(
|