Unverified Commit 96d6e165 authored by SangKim's avatar SangKim Committed by GitHub
Browse files

Enable image resizing to adjust its height and width in...

Enable image resizing to adjust its height and width in StableDiffusionXLInstructPix2PixPipeline (#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
parent c11de135
......@@ -1109,7 +1109,7 @@ def main():
progress_bar.set_postfix(**logs)
### BEGIN: Perform validation every `validation_epochs` steps
if global_step % args.validation_steps == 0 or global_step == 1:
if global_step % args.validation_steps == 0:
if (args.val_image_url_or_path is not None) and (args.validation_prompt is not None):
logger.info(
f"Running validation... \n Generating {args.num_validation_images} images with prompt:"
......
......@@ -858,7 +858,7 @@ class StableDiffusionXLInstructPix2PixPipeline(
)
# 4. Preprocess image
image = self.image_processor.preprocess(image).to(device)
image = self.image_processor.preprocess(image, height=height, width=width).to(device)
# 5. Prepare timesteps
self.scheduler.set_timesteps(num_inference_steps, device=device)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment