Skip to content

Commit 39e461f

Browse files
kim-sangyeonJimmy
authored and
Jimmy
committed
Enable image resizing to adjust its height and width in StableDiffusionXLInstructPix2PixPipeline (huggingface#6581)
* Enable image resizing to adjust its height and width in StableDiffusionXLInstructPix2PixPipeline * Ensure that validation is performed at every 'validation_step', not at every step
1 parent 2936984 commit 39e461f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/instruct_pix2pix/train_instruct_pix2pix_sdxl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ def collate_fn(examples):
11091109
progress_bar.set_postfix(**logs)
11101110

11111111
### BEGIN: Perform validation every `validation_epochs` steps
1112-
if global_step % args.validation_steps == 0 or global_step == 1:
1112+
if global_step % args.validation_steps == 0:
11131113
if (args.val_image_url_or_path is not None) and (args.validation_prompt is not None):
11141114
logger.info(
11151115
f"Running validation... \n Generating {args.num_validation_images} images with prompt:"

src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_instruct_pix2pix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ def __call__(
858858
)
859859

860860
# 4. Preprocess image
861-
image = self.image_processor.preprocess(image).to(device)
861+
image = self.image_processor.preprocess(image, height=height, width=width).to(device)
862862

863863
# 5. Prepare timesteps
864864
self.scheduler.set_timesteps(num_inference_steps, device=device)

0 commit comments

Comments
 (0)