Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
diffusers
Commits
3a0d3da6
Unverified
Commit
3a0d3da6
authored
Feb 06, 2023
by
nickkolok
Committed by
GitHub
Feb 06, 2023
Browse files
Fix a typo: bfloa16 -> bfloat16 (#2243)
parent
22c1ba56
Changes
28
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
20 additions
and
20 deletions
+20
-20
examples/community/composable_stable_diffusion.py
examples/community/composable_stable_diffusion.py
+1
-1
examples/community/imagic_stable_diffusion.py
examples/community/imagic_stable_diffusion.py
+1
-1
examples/community/interpolate_stable_diffusion.py
examples/community/interpolate_stable_diffusion.py
+1
-1
examples/community/lpw_stable_diffusion.py
examples/community/lpw_stable_diffusion.py
+1
-1
examples/community/multilingual_stable_diffusion.py
examples/community/multilingual_stable_diffusion.py
+1
-1
examples/community/sd_text2img_k_diffusion.py
examples/community/sd_text2img_k_diffusion.py
+1
-1
examples/community/seed_resize_stable_diffusion.py
examples/community/seed_resize_stable_diffusion.py
+1
-1
examples/community/speech_to_image_diffusion.py
examples/community/speech_to_image_diffusion.py
+1
-1
examples/community/wildcard_stable_diffusion.py
examples/community/wildcard_stable_diffusion.py
+1
-1
src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py
...ffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py
+1
-1
src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion_img2img.py
...pipelines/alt_diffusion/pipeline_alt_diffusion_img2img.py
+1
-1
src/diffusers/pipelines/paint_by_example/pipeline_paint_by_example.py
...s/pipelines/paint_by_example/pipeline_paint_by_example.py
+1
-1
src/diffusers/pipelines/stable_diffusion/pipeline_cycle_diffusion.py
...rs/pipelines/stable_diffusion/pipeline_cycle_diffusion.py
+1
-1
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py
...s/pipelines/stable_diffusion/pipeline_stable_diffusion.py
+1
-1
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_depth2img.py
...s/stable_diffusion/pipeline_stable_diffusion_depth2img.py
+1
-1
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_image_variation.py
...le_diffusion/pipeline_stable_diffusion_image_variation.py
+1
-1
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py
...nes/stable_diffusion/pipeline_stable_diffusion_img2img.py
+1
-1
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py
...nes/stable_diffusion/pipeline_stable_diffusion_inpaint.py
+1
-1
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint_legacy.py
...ble_diffusion/pipeline_stable_diffusion_inpaint_legacy.py
+1
-1
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py
...e_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py
+1
-1
No files found.
examples/community/composable_stable_diffusion.py
View file @
3a0d3da6
...
@@ -340,7 +340,7 @@ class ComposableStableDiffusionPipeline(DiffusionPipeline):
...
@@ -340,7 +340,7 @@ class ComposableStableDiffusionPipeline(DiffusionPipeline):
latents
=
1
/
0.18215
*
latents
latents
=
1
/
0.18215
*
latents
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa16
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa
t
16
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
return
image
return
image
...
...
examples/community/imagic_stable_diffusion.py
View file @
3a0d3da6
...
@@ -479,7 +479,7 @@ class ImagicStableDiffusionPipeline(DiffusionPipeline):
...
@@ -479,7 +479,7 @@ class ImagicStableDiffusionPipeline(DiffusionPipeline):
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa16
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa
t
16
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
if
self
.
safety_checker
is
not
None
:
if
self
.
safety_checker
is
not
None
:
...
...
examples/community/interpolate_stable_diffusion.py
View file @
3a0d3da6
...
@@ -379,7 +379,7 @@ class StableDiffusionWalkPipeline(DiffusionPipeline):
...
@@ -379,7 +379,7 @@ class StableDiffusionWalkPipeline(DiffusionPipeline):
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa16
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa
t
16
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
if
self
.
safety_checker
is
not
None
:
if
self
.
safety_checker
is
not
None
:
...
...
examples/community/lpw_stable_diffusion.py
View file @
3a0d3da6
...
@@ -600,7 +600,7 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
...
@@ -600,7 +600,7 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
latents
=
1
/
0.18215
*
latents
latents
=
1
/
0.18215
*
latents
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa16
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa
t
16
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
return
image
return
image
...
...
examples/community/multilingual_stable_diffusion.py
View file @
3a0d3da6
...
@@ -414,7 +414,7 @@ class MultilingualStableDiffusion(DiffusionPipeline):
...
@@ -414,7 +414,7 @@ class MultilingualStableDiffusion(DiffusionPipeline):
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa16
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa
t
16
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
if
self
.
safety_checker
is
not
None
:
if
self
.
safety_checker
is
not
None
:
...
...
examples/community/sd_text2img_k_diffusion.py
View file @
3a0d3da6
...
@@ -300,7 +300,7 @@ class StableDiffusionPipeline(DiffusionPipeline):
...
@@ -300,7 +300,7 @@ class StableDiffusionPipeline(DiffusionPipeline):
latents
=
1
/
0.18215
*
latents
latents
=
1
/
0.18215
*
latents
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa16
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa
t
16
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
return
image
return
image
...
...
examples/community/seed_resize_stable_diffusion.py
View file @
3a0d3da6
...
@@ -344,7 +344,7 @@ class SeedResizeStableDiffusionPipeline(DiffusionPipeline):
...
@@ -344,7 +344,7 @@ class SeedResizeStableDiffusionPipeline(DiffusionPipeline):
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa16
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa
t
16
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
if
self
.
safety_checker
is
not
None
:
if
self
.
safety_checker
is
not
None
:
...
...
examples/community/speech_to_image_diffusion.py
View file @
3a0d3da6
...
@@ -249,7 +249,7 @@ class SpeechToImagePipeline(DiffusionPipeline):
...
@@ -249,7 +249,7 @@ class SpeechToImagePipeline(DiffusionPipeline):
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa16
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa
t
16
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
if
output_type
==
"pil"
:
if
output_type
==
"pil"
:
...
...
examples/community/wildcard_stable_diffusion.py
View file @
3a0d3da6
...
@@ -396,7 +396,7 @@ class WildcardStableDiffusionPipeline(DiffusionPipeline):
...
@@ -396,7 +396,7 @@ class WildcardStableDiffusionPipeline(DiffusionPipeline):
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa16
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa
t
16
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
if
self
.
safety_checker
is
not
None
:
if
self
.
safety_checker
is
not
None
:
...
...
src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py
View file @
3a0d3da6
...
@@ -372,7 +372,7 @@ class AltDiffusionPipeline(DiffusionPipeline):
...
@@ -372,7 +372,7 @@ class AltDiffusionPipeline(DiffusionPipeline):
latents
=
1
/
self
.
vae
.
config
.
scaling_factor
*
latents
latents
=
1
/
self
.
vae
.
config
.
scaling_factor
*
latents
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa16
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa
t
16
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
return
image
return
image
...
...
src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion_img2img.py
View file @
3a0d3da6
...
@@ -394,7 +394,7 @@ class AltDiffusionImg2ImgPipeline(DiffusionPipeline):
...
@@ -394,7 +394,7 @@ class AltDiffusionImg2ImgPipeline(DiffusionPipeline):
latents
=
1
/
self
.
vae
.
config
.
scaling_factor
*
latents
latents
=
1
/
self
.
vae
.
config
.
scaling_factor
*
latents
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa16
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa
t
16
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
return
image
return
image
...
...
src/diffusers/pipelines/paint_by_example/pipeline_paint_by_example.py
View file @
3a0d3da6
...
@@ -260,7 +260,7 @@ class PaintByExamplePipeline(DiffusionPipeline):
...
@@ -260,7 +260,7 @@ class PaintByExamplePipeline(DiffusionPipeline):
latents
=
1
/
self
.
vae
.
config
.
scaling_factor
*
latents
latents
=
1
/
self
.
vae
.
config
.
scaling_factor
*
latents
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa16
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa
t
16
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
return
image
return
image
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_cycle_diffusion.py
View file @
3a0d3da6
...
@@ -477,7 +477,7 @@ class CycleDiffusionPipeline(DiffusionPipeline):
...
@@ -477,7 +477,7 @@ class CycleDiffusionPipeline(DiffusionPipeline):
latents
=
1
/
self
.
vae
.
config
.
scaling_factor
*
latents
latents
=
1
/
self
.
vae
.
config
.
scaling_factor
*
latents
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa16
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa
t
16
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
return
image
return
image
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py
View file @
3a0d3da6
...
@@ -369,7 +369,7 @@ class StableDiffusionPipeline(DiffusionPipeline):
...
@@ -369,7 +369,7 @@ class StableDiffusionPipeline(DiffusionPipeline):
latents
=
1
/
self
.
vae
.
config
.
scaling_factor
*
latents
latents
=
1
/
self
.
vae
.
config
.
scaling_factor
*
latents
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa16
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa
t
16
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
return
image
return
image
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_depth2img.py
View file @
3a0d3da6
...
@@ -313,7 +313,7 @@ class StableDiffusionDepth2ImgPipeline(DiffusionPipeline):
...
@@ -313,7 +313,7 @@ class StableDiffusionDepth2ImgPipeline(DiffusionPipeline):
latents
=
1
/
self
.
vae
.
config
.
scaling_factor
*
latents
latents
=
1
/
self
.
vae
.
config
.
scaling_factor
*
latents
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa16
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa
t
16
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
return
image
return
image
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_image_variation.py
View file @
3a0d3da6
...
@@ -198,7 +198,7 @@ class StableDiffusionImageVariationPipeline(DiffusionPipeline):
...
@@ -198,7 +198,7 @@ class StableDiffusionImageVariationPipeline(DiffusionPipeline):
latents
=
1
/
self
.
vae
.
config
.
scaling_factor
*
latents
latents
=
1
/
self
.
vae
.
config
.
scaling_factor
*
latents
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa16
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa
t
16
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
return
image
return
image
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py
View file @
3a0d3da6
...
@@ -403,7 +403,7 @@ class StableDiffusionImg2ImgPipeline(DiffusionPipeline):
...
@@ -403,7 +403,7 @@ class StableDiffusionImg2ImgPipeline(DiffusionPipeline):
latents
=
1
/
self
.
vae
.
config
.
scaling_factor
*
latents
latents
=
1
/
self
.
vae
.
config
.
scaling_factor
*
latents
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa16
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa
t
16
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
return
image
return
image
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py
View file @
3a0d3da6
...
@@ -469,7 +469,7 @@ class StableDiffusionInpaintPipeline(DiffusionPipeline):
...
@@ -469,7 +469,7 @@ class StableDiffusionInpaintPipeline(DiffusionPipeline):
latents
=
1
/
self
.
vae
.
config
.
scaling_factor
*
latents
latents
=
1
/
self
.
vae
.
config
.
scaling_factor
*
latents
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa16
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa
t
16
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
return
image
return
image
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint_legacy.py
View file @
3a0d3da6
...
@@ -388,7 +388,7 @@ class StableDiffusionInpaintPipelineLegacy(DiffusionPipeline):
...
@@ -388,7 +388,7 @@ class StableDiffusionInpaintPipelineLegacy(DiffusionPipeline):
latents
=
1
/
self
.
vae
.
config
.
scaling_factor
*
latents
latents
=
1
/
self
.
vae
.
config
.
scaling_factor
*
latents
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa16
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa
t
16
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
return
image
return
image
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py
View file @
3a0d3da6
...
@@ -591,7 +591,7 @@ class StableDiffusionInstructPix2PixPipeline(DiffusionPipeline):
...
@@ -591,7 +591,7 @@ class StableDiffusionInstructPix2PixPipeline(DiffusionPipeline):
latents
=
1
/
self
.
vae
.
config
.
scaling_factor
*
latents
latents
=
1
/
self
.
vae
.
config
.
scaling_factor
*
latents
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
self
.
vae
.
decode
(
latents
).
sample
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
image
=
(
image
/
2
+
0.5
).
clamp
(
0
,
1
)
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa16
# we always cast to float32 as this does not cause significant overhead and is compatible with bfloa
t
16
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
return
image
return
image
...
...
Prev
1
2
Next
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