Spaces:
Running
on
Zero
Running
on
Zero
Update pipeline.py
Browse files- pipeline.py +3 -1
pipeline.py
CHANGED
@@ -261,6 +261,7 @@ class Flex2Pipeline(FluxControlPipeline):
|
|
261 |
|
262 |
# apply control strength
|
263 |
control_latents = control_latents * control_strength
|
|
|
264 |
|
265 |
if inpaint_image is None and inpaint_mask is None:
|
266 |
inpaint_latents = torch.zeros(
|
@@ -293,6 +294,7 @@ class Flex2Pipeline(FluxControlPipeline):
|
|
293 |
)
|
294 |
inpaint_image = self.vae.encode(inpaint_image).latent_dist.sample(generator=generator)
|
295 |
inpaint_latents = (inpaint_image - self.vae.config.shift_factor) * self.vae.config.scaling_factor
|
|
|
296 |
height_inpaint_image, width_inpaint_image = inpaint_image.shape[2:]
|
297 |
|
298 |
inpaint_mask = self.prepare_image(
|
@@ -308,7 +310,7 @@ class Flex2Pipeline(FluxControlPipeline):
|
|
308 |
inpaint_mask = inpaint_mask[:, 0:1, :, :] * 0.5 + 0.5
|
309 |
# resize to match height_inpaint_image and width_inpaint_image
|
310 |
inpaint_latents_mask = F.interpolate(inpaint_mask, size=(height_inpaint_image, width_inpaint_image), mode="bilinear", align_corners=False)
|
311 |
-
|
312 |
# apply inverted mask to inpaint latents
|
313 |
inpaint_latents = inpaint_latents * (1 - inpaint_latents_mask)
|
314 |
|
|
|
261 |
|
262 |
# apply control strength
|
263 |
control_latents = control_latents * control_strength
|
264 |
+
print("control_latents", control_latents.shape)
|
265 |
|
266 |
if inpaint_image is None and inpaint_mask is None:
|
267 |
inpaint_latents = torch.zeros(
|
|
|
294 |
)
|
295 |
inpaint_image = self.vae.encode(inpaint_image).latent_dist.sample(generator=generator)
|
296 |
inpaint_latents = (inpaint_image - self.vae.config.shift_factor) * self.vae.config.scaling_factor
|
297 |
+
print("inpaint_latents", inpaint_latents.shape)
|
298 |
height_inpaint_image, width_inpaint_image = inpaint_image.shape[2:]
|
299 |
|
300 |
inpaint_mask = self.prepare_image(
|
|
|
310 |
inpaint_mask = inpaint_mask[:, 0:1, :, :] * 0.5 + 0.5
|
311 |
# resize to match height_inpaint_image and width_inpaint_image
|
312 |
inpaint_latents_mask = F.interpolate(inpaint_mask, size=(height_inpaint_image, width_inpaint_image), mode="bilinear", align_corners=False)
|
313 |
+
print("inpaint_latents_mask", inpaint_latents_mask.shape)
|
314 |
# apply inverted mask to inpaint latents
|
315 |
inpaint_latents = inpaint_latents * (1 - inpaint_latents_mask)
|
316 |
|