Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
0c35b580
Unverified
Commit
0c35b580
authored
Nov 17, 2025
by
David Bertoin
Committed by
GitHub
Nov 17, 2025
Browse files
[PRX pipeline]: add 1024 resolution ratio bins (#12670)
add 1024 ratio bins
parent
01a56927
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
4 deletions
+39
-4
src/diffusers/pipelines/prx/pipeline_prx.py
src/diffusers/pipelines/prx/pipeline_prx.py
+39
-4
No files found.
src/diffusers/pipelines/prx/pipeline_prx.py
View file @
0c35b580
...
@@ -69,6 +69,39 @@ ASPECT_RATIO_512_BIN = {
...
@@ -69,6 +69,39 @@ ASPECT_RATIO_512_BIN = {
"2.0"
:
[
704
,
352
],
"2.0"
:
[
704
,
352
],
}
}
ASPECT_RATIO_1024_BIN
=
{
"0.49"
:
[
704
,
1440
],
"0.52"
:
[
736
,
1408
],
"0.53"
:
[
736
,
1376
],
"0.57"
:
[
768
,
1344
],
"0.59"
:
[
768
,
1312
],
"0.62"
:
[
800
,
1280
],
"0.67"
:
[
832
,
1248
],
"0.68"
:
[
832
,
1216
],
"0.78"
:
[
896
,
1152
],
"0.83"
:
[
928
,
1120
],
"0.94"
:
[
992
,
1056
],
"1.0"
:
[
1024
,
1024
],
"1.06"
:
[
1056
,
992
],
"1.13"
:
[
1088
,
960
],
"1.21"
:
[
1120
,
928
],
"1.29"
:
[
1152
,
896
],
"1.37"
:
[
1184
,
864
],
"1.46"
:
[
1216
,
832
],
"1.5"
:
[
1248
,
832
],
"1.71"
:
[
1312
,
768
],
"1.75"
:
[
1344
,
768
],
"1.87"
:
[
1376
,
736
],
"1.91"
:
[
1408
,
736
],
"2.05"
:
[
1440
,
704
],
}
ASPECT_RATIO_BINS
=
{
256
:
ASPECT_RATIO_256_BIN
,
512
:
ASPECT_RATIO_512_BIN
,
1024
:
ASPECT_RATIO_1024_BIN
,
}
logger
=
logging
.
get_logger
(
__name__
)
logger
=
logging
.
get_logger
(
__name__
)
...
@@ -600,10 +633,12 @@ class PRXPipeline(
...
@@ -600,10 +633,12 @@ class PRXPipeline(
"Resolution binning requires a VAE with image_processor, but VAE is not available. "
"Resolution binning requires a VAE with image_processor, but VAE is not available. "
"Set use_resolution_binning=False or provide a VAE."
"Set use_resolution_binning=False or provide a VAE."
)
)
if
self
.
default_sample_size
<=
256
:
if
self
.
default_sample_size
not
in
ASPECT_RATIO_BINS
:
aspect_ratio_bin
=
ASPECT_RATIO_256_BIN
raise
ValueError
(
else
:
f
"Resolution binning is only supported for default_sample_size in
{
list
(
ASPECT_RATIO_BINS
.
keys
())
}
, "
aspect_ratio_bin
=
ASPECT_RATIO_512_BIN
f
"but got
{
self
.
default_sample_size
}
. Set use_resolution_binning=False to disable aspect ratio binning."
)
aspect_ratio_bin
=
ASPECT_RATIO_BINS
[
self
.
default_sample_size
]
# Store original dimensions
# Store original dimensions
orig_height
,
orig_width
=
height
,
width
orig_height
,
orig_width
=
height
,
width
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment