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
bc0cee9d
Unverified
Commit
bc0cee9d
authored
Feb 13, 2023
by
Patrick von Platen
Committed by
GitHub
Feb 13, 2023
Browse files
[Latent Upscaling] Remove unused noise (#2298)
parent
1f5f17c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_latent_upscale.py
...ble_diffusion/pipeline_stable_diffusion_latent_upscale.py
+2
-3
No files found.
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_latent_upscale.py
View file @
bc0cee9d
...
@@ -227,7 +227,7 @@ class StableDiffusionLatentUpscalePipeline(DiffusionPipeline):
...
@@ -227,7 +227,7 @@ class StableDiffusionLatentUpscalePipeline(DiffusionPipeline):
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
image
=
image
.
cpu
().
permute
(
0
,
2
,
3
,
1
).
float
().
numpy
()
return
image
return
image
def
check_inputs
(
self
,
prompt
,
image
,
noise_level
,
callback_steps
):
def
check_inputs
(
self
,
prompt
,
image
,
callback_steps
):
if
not
isinstance
(
prompt
,
str
)
and
not
isinstance
(
prompt
,
list
):
if
not
isinstance
(
prompt
,
str
)
and
not
isinstance
(
prompt
,
list
):
raise
ValueError
(
f
"`prompt` has to be of type `str` or `list` but is
{
type
(
prompt
)
}
"
)
raise
ValueError
(
f
"`prompt` has to be of type `str` or `list` but is
{
type
(
prompt
)
}
"
)
...
@@ -285,7 +285,6 @@ class StableDiffusionLatentUpscalePipeline(DiffusionPipeline):
...
@@ -285,7 +285,6 @@ class StableDiffusionLatentUpscalePipeline(DiffusionPipeline):
image
:
Union
[
torch
.
FloatTensor
,
PIL
.
Image
.
Image
,
List
[
PIL
.
Image
.
Image
]],
image
:
Union
[
torch
.
FloatTensor
,
PIL
.
Image
.
Image
,
List
[
PIL
.
Image
.
Image
]],
num_inference_steps
:
int
=
75
,
num_inference_steps
:
int
=
75
,
guidance_scale
:
float
=
9.0
,
guidance_scale
:
float
=
9.0
,
noise_level
:
int
=
0
,
negative_prompt
:
Optional
[
Union
[
str
,
List
[
str
]]]
=
None
,
negative_prompt
:
Optional
[
Union
[
str
,
List
[
str
]]]
=
None
,
generator
:
Optional
[
Union
[
torch
.
Generator
,
List
[
torch
.
Generator
]]]
=
None
,
generator
:
Optional
[
Union
[
torch
.
Generator
,
List
[
torch
.
Generator
]]]
=
None
,
latents
:
Optional
[
torch
.
FloatTensor
]
=
None
,
latents
:
Optional
[
torch
.
FloatTensor
]
=
None
,
...
@@ -386,7 +385,7 @@ class StableDiffusionLatentUpscalePipeline(DiffusionPipeline):
...
@@ -386,7 +385,7 @@ class StableDiffusionLatentUpscalePipeline(DiffusionPipeline):
"""
"""
# 1. Check inputs
# 1. Check inputs
self
.
check_inputs
(
prompt
,
image
,
noise_level
,
callback_steps
)
self
.
check_inputs
(
prompt
,
image
,
callback_steps
)
# 2. Define call parameters
# 2. Define call parameters
batch_size
=
1
if
isinstance
(
prompt
,
str
)
else
len
(
prompt
)
batch_size
=
1
if
isinstance
(
prompt
,
str
)
else
len
(
prompt
)
...
...
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