Skip to content

Commit 15bf914

Browse files
authored
Update train_instruct_pix2pix_sdxl.py
1 parent efc2266 commit 15bf914

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/instruct_pix2pix/train_instruct_pix2pix_sdxl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ def preprocess_images(examples):
766766
)
767767
# We need to ensure that the original and the edited images undergo the same
768768
# augmentation transforms.
769-
images = np.concatenate([original_images, edited_images])
769+
images = np.stack([original_images, edited_images])
770770
images = torch.tensor(images)
771771
images = 2 * (images / 255) - 1
772772
return train_transforms(images)
@@ -906,7 +906,7 @@ def preprocess_train(examples):
906906
# Since the original and edited images were concatenated before
907907
# applying the transformations, we need to separate them and reshape
908908
# them accordingly.
909-
original_images, edited_images = preprocessed_images.chunk(2)
909+
original_images, edited_images = preprocessed_images
910910
original_images = original_images.reshape(-1, 3, args.resolution, args.resolution)
911911
edited_images = edited_images.reshape(-1, 3, args.resolution, args.resolution)
912912

0 commit comments

Comments
 (0)