Commit 7e6886f
authored
controlnet training resize inputs to multiple of 8 (huggingface#3135)
controlnet training center crop input images to multiple of 8
The pipeline code resizes inputs to multiples of 8.
Not doing this resizing in the training script is causing
the encoded image to have different height/width dimensions
than the encoded conditioning image (which uses a separate
encoder that's part of the controlnet model).
We resize and center crop the inputs to make sure they're the
same size (as well as all other images in the batch). We also
check that the initial resolution is a multiple of 8.1 parent a4c91be commit 7e6886f
1 file changed
+7
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
525 | 525 | | |
526 | 526 | | |
527 | 527 | | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
528 | 533 | | |
529 | 534 | | |
530 | 535 | | |
| |||
607 | 612 | | |
608 | 613 | | |
609 | 614 | | |
| 615 | + | |
610 | 616 | | |
611 | 617 | | |
612 | 618 | | |
| |||
615 | 621 | | |
616 | 622 | | |
617 | 623 | | |
| 624 | + | |
618 | 625 | | |
619 | 626 | | |
620 | 627 | | |
| |||
0 commit comments