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
bdc75e75
Unverified
Commit
bdc75e75
authored
May 26, 2023
by
Will Berman
Committed by
GitHub
May 26, 2023
Browse files
[IF super res] correctly normalize PIL input (#3536)
* [IF super res] correctl normalize PIL input * 175 -> 127.5
parent
1d1f648c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py
...lines/deepfloyd_if/pipeline_if_img2img_superresolution.py
+1
-1
src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py
...es/deepfloyd_if/pipeline_if_inpainting_superresolution.py
+1
-1
src/diffusers/pipelines/deepfloyd_if/pipeline_if_superresolution.py
...ers/pipelines/deepfloyd_if/pipeline_if_superresolution.py
+1
-1
No files found.
src/diffusers/pipelines/deepfloyd_if/pipeline_if_img2img_superresolution.py
View file @
bdc75e75
...
...
@@ -759,7 +759,7 @@ class IFImg2ImgSuperResolutionPipeline(DiffusionPipeline):
image
=
[
image
]
if
isinstance
(
image
[
0
],
PIL
.
Image
.
Image
):
image
=
[
np
.
array
(
i
).
astype
(
np
.
float32
)
/
255
.0
for
i
in
image
]
image
=
[
np
.
array
(
i
).
astype
(
np
.
float32
)
/
127.5
-
1
.0
for
i
in
image
]
image
=
np
.
stack
(
image
,
axis
=
0
)
# to np
image
=
torch
.
from_numpy
(
image
.
transpose
(
0
,
3
,
1
,
2
))
...
...
src/diffusers/pipelines/deepfloyd_if/pipeline_if_inpainting_superresolution.py
View file @
bdc75e75
...
...
@@ -795,7 +795,7 @@ class IFInpaintingSuperResolutionPipeline(DiffusionPipeline):
image
=
[
image
]
if
isinstance
(
image
[
0
],
PIL
.
Image
.
Image
):
image
=
[
np
.
array
(
i
).
astype
(
np
.
float32
)
/
255
.0
for
i
in
image
]
image
=
[
np
.
array
(
i
).
astype
(
np
.
float32
)
/
127.5
-
1
.0
for
i
in
image
]
image
=
np
.
stack
(
image
,
axis
=
0
)
# to np
image
=
torch
.
from_numpy
(
image
.
transpose
(
0
,
3
,
1
,
2
))
...
...
src/diffusers/pipelines/deepfloyd_if/pipeline_if_superresolution.py
View file @
bdc75e75
...
...
@@ -664,7 +664,7 @@ class IFSuperResolutionPipeline(DiffusionPipeline):
image
=
[
image
]
if
isinstance
(
image
[
0
],
PIL
.
Image
.
Image
):
image
=
[
np
.
array
(
i
).
astype
(
np
.
float32
)
/
255
.0
for
i
in
image
]
image
=
[
np
.
array
(
i
).
astype
(
np
.
float32
)
/
127.5
-
1
.0
for
i
in
image
]
image
=
np
.
stack
(
image
,
axis
=
0
)
# to np
image
=
torch
.
from_numpy
(
image
.
transpose
(
0
,
3
,
1
,
2
))
...
...
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