Skip to content

Commit 60f23a0

Browse files
author
fzilan
committed
update flux controlnet training script
1 parent 8e2df3a commit 60f23a0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/diffusers/controlnet/train_controlnet_flux.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ def log_validation(pipeline, args, step, trackers, logging_dir, is_final_validat
116116
guidance_scale=3.5,
117117
generator=generator,
118118
)[0][0]
119+
image = image.resize((args.resolution, args.resolution))
119120
images.append(image)
120121
image_logs.append(
121122
{"validation_image": validation_image, "images": images, "validation_prompt": validation_prompt}
@@ -1349,8 +1350,8 @@ def construct(self, pixel_values, conditioning_pixel_values, prompt_ids, pooled_
13491350

13501351
latent_image_ids = FluxControlNetPipeline._prepare_latent_image_ids(
13511352
batch_size=pixel_latents_tmp.shape[0], # no use
1352-
height=pixel_latents_tmp.shape[2],
1353-
width=pixel_latents_tmp.shape[3],
1353+
height=pixel_latents_tmp.shape[2] // 2,
1354+
width=pixel_latents_tmp.shape[3] // 2,
13541355
dtype=self.weight_dtype,
13551356
)
13561357

0 commit comments

Comments
 (0)