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
cc436087
"csrc/cpu_ops.cpp" did not exist on "33efe4a09f459832e8beceba70add0695cc485e4"
Unverified
Commit
cc436087
authored
Oct 26, 2022
by
Yuta Hayashibe
Committed by
GitHub
Oct 26, 2022
Browse files
Fix typos (#978)
parent
d7d68414
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
11 deletions
+11
-11
examples/community/README.md
examples/community/README.md
+1
-1
examples/community/composable_stable_diffusion.py
examples/community/composable_stable_diffusion.py
+2
-2
examples/community/lpw_stable_diffusion.py
examples/community/lpw_stable_diffusion.py
+3
-3
examples/community/lpw_stable_diffusion_onnx.py
examples/community/lpw_stable_diffusion_onnx.py
+3
-3
src/diffusers/pipeline_utils.py
src/diffusers/pipeline_utils.py
+2
-2
No files found.
examples/community/README.md
View file @
cc436087
...
@@ -355,7 +355,7 @@ generator = th.Generator("cuda").manual_seed(0)
...
@@ -355,7 +355,7 @@ generator = th.Generator("cuda").manual_seed(0)
seed
=
0
seed
=
0
prompt
=
"a forest | a camel"
prompt
=
"a forest | a camel"
weights
=
" 1 | 1"
# Equal weight to each prompt. C
n
a be negative
weights
=
" 1 | 1"
# Equal weight to each prompt. Ca
n
be negative
images
=
[]
images
=
[]
for
i
in
range
(
4
):
for
i
in
range
(
4
):
...
...
examples/community/composable_stable_diffusion.py
View file @
cc436087
...
@@ -133,7 +133,7 @@ class ComposableStableDiffusionPipeline(DiffusionPipeline):
...
@@ -133,7 +133,7 @@ class ComposableStableDiffusionPipeline(DiffusionPipeline):
tensor will ge generated by sampling using the supplied random `generator`.
tensor will ge generated by sampling using the supplied random `generator`.
output_type (`str`, *optional*, defaults to `"pil"`):
output_type (`str`, *optional*, defaults to `"pil"`):
The output format of the generate image. Choose between
The output format of the generate image. Choose between
[PIL](https://pillow.readthedocs.io/en/stable/): `PIL.Image.Image` or `n
d
.array`.
[PIL](https://pillow.readthedocs.io/en/stable/): `PIL.Image.Image` or `n
p
.array`.
return_dict (`bool`, *optional*, defaults to `True`):
return_dict (`bool`, *optional*, defaults to `True`):
Whether or not to return a [`~pipelines.stable_diffusion.StableDiffusionPipelineOutput`] instead of a
Whether or not to return a [`~pipelines.stable_diffusion.StableDiffusionPipelineOutput`] instead of a
plain tuple.
plain tuple.
...
@@ -264,7 +264,7 @@ class ComposableStableDiffusionPipeline(DiffusionPipeline):
...
@@ -264,7 +264,7 @@ class ComposableStableDiffusionPipeline(DiffusionPipeline):
self
.
scheduler
.
set_timesteps
(
num_inference_steps
,
**
extra_set_kwargs
)
self
.
scheduler
.
set_timesteps
(
num_inference_steps
,
**
extra_set_kwargs
)
# if we use LMSDiscreteScheduler, let's make sure latents are mul
i
tplied by sigmas
# if we use LMSDiscreteScheduler, let's make sure latents are mult
i
plied by sigmas
if
isinstance
(
self
.
scheduler
,
LMSDiscreteScheduler
):
if
isinstance
(
self
.
scheduler
,
LMSDiscreteScheduler
):
latents
=
latents
*
self
.
scheduler
.
sigmas
[
0
]
latents
=
latents
*
self
.
scheduler
.
sigmas
[
0
]
...
...
examples/community/lpw_stable_diffusion.py
View file @
cc436087
...
@@ -40,7 +40,7 @@ re_attention = re.compile(
...
@@ -40,7 +40,7 @@ re_attention = re.compile(
def
parse_prompt_attention
(
text
):
def
parse_prompt_attention
(
text
):
"""
"""
Parses a string with attention tokens and returns a list of pairs: text and its asso
i
cated weight.
Parses a string with attention tokens and returns a list of pairs: text and its assoc
i
ated weight.
Accepted tokens are:
Accepted tokens are:
(abc) - increases attention to abc by a multiplier of 1.1
(abc) - increases attention to abc by a multiplier of 1.1
(abc:3.12) - increases attention to abc by a multiplier of 3.12
(abc:3.12) - increases attention to abc by a multiplier of 3.12
...
@@ -237,9 +237,9 @@ def get_weighted_text_embeddings(
...
@@ -237,9 +237,9 @@ def get_weighted_text_embeddings(
r
"""
r
"""
Prompts can be assigned with local weights using brackets. For example,
Prompts can be assigned with local weights using brackets. For example,
prompt 'A (very beautiful) masterpiece' highlights the words 'very beautiful',
prompt 'A (very beautiful) masterpiece' highlights the words 'very beautiful',
and the embedding tokens corresponding to the words get multipled by a constant, 1.1.
and the embedding tokens corresponding to the words get multipl
i
ed by a constant, 1.1.
Also, to regularize of the embedding, the weighted embedding would be scaled to preserve the origi
o
nal mean.
Also, to regularize of the embedding, the weighted embedding would be scaled to preserve the original mean.
Args:
Args:
pipe (`DiffusionPipeline`):
pipe (`DiffusionPipeline`):
...
...
examples/community/lpw_stable_diffusion_onnx.py
View file @
cc436087
...
@@ -38,7 +38,7 @@ re_attention = re.compile(
...
@@ -38,7 +38,7 @@ re_attention = re.compile(
def
parse_prompt_attention
(
text
):
def
parse_prompt_attention
(
text
):
"""
"""
Parses a string with attention tokens and returns a list of pairs: text and its asso
i
cated weight.
Parses a string with attention tokens and returns a list of pairs: text and its assoc
i
ated weight.
Accepted tokens are:
Accepted tokens are:
(abc) - increases attention to abc by a multiplier of 1.1
(abc) - increases attention to abc by a multiplier of 1.1
(abc:3.12) - increases attention to abc by a multiplier of 3.12
(abc:3.12) - increases attention to abc by a multiplier of 3.12
...
@@ -236,9 +236,9 @@ def get_weighted_text_embeddings(
...
@@ -236,9 +236,9 @@ def get_weighted_text_embeddings(
r
"""
r
"""
Prompts can be assigned with local weights using brackets. For example,
Prompts can be assigned with local weights using brackets. For example,
prompt 'A (very beautiful) masterpiece' highlights the words 'very beautiful',
prompt 'A (very beautiful) masterpiece' highlights the words 'very beautiful',
and the embedding tokens corresponding to the words get multipled by a constant, 1.1.
and the embedding tokens corresponding to the words get multipl
i
ed by a constant, 1.1.
Also, to regularize of the embedding, the weighted embedding would be scaled to preserve the origi
o
nal mean.
Also, to regularize of the embedding, the weighted embedding would be scaled to preserve the original mean.
Args:
Args:
pipe (`DiffusionPipeline`):
pipe (`DiffusionPipeline`):
...
...
src/diffusers/pipeline_utils.py
View file @
cc436087
...
@@ -584,7 +584,7 @@ class DiffusionPipeline(ConfigMixin):
...
@@ -584,7 +584,7 @@ class DiffusionPipeline(ConfigMixin):
def
components
(
self
)
->
Dict
[
str
,
Any
]:
def
components
(
self
)
->
Dict
[
str
,
Any
]:
r
"""
r
"""
The `self.comp
e
nents` property can be useful to run different pipelines with the same weights and
The `self.comp
o
nents` property can be useful to run different pipelines with the same weights and
configurations to not have to re-allocate memory.
configurations to not have to re-allocate memory.
Examples:
Examples:
...
@@ -602,7 +602,7 @@ class DiffusionPipeline(ConfigMixin):
...
@@ -602,7 +602,7 @@ class DiffusionPipeline(ConfigMixin):
```
```
Returns:
Returns:
A dictionaly containing all the modules needed to initialize the pip
l
eline.
A dictionaly containing all the modules needed to initialize the pipeline.
"""
"""
components
=
{
k
:
getattr
(
self
,
k
)
for
k
in
self
.
config
.
keys
()
if
not
k
.
startswith
(
"_"
)}
components
=
{
k
:
getattr
(
self
,
k
)
for
k
in
self
.
config
.
keys
()
if
not
k
.
startswith
(
"_"
)}
expected_modules
=
set
(
inspect
.
signature
(
self
.
__init__
).
parameters
.
keys
())
-
set
([
"self"
])
expected_modules
=
set
(
inspect
.
signature
(
self
.
__init__
).
parameters
.
keys
())
-
set
([
"self"
])
...
...
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