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
3231712b
Commit
3231712b
authored
Feb 17, 2023
by
Patrick von Platen
Browse files
Post release 0.14
parent
b2c1e0d6
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
15 additions
and
66 deletions
+15
-66
examples/community/imagic_stable_diffusion.py
examples/community/imagic_stable_diffusion.py
+1
-6
examples/community/lpw_stable_diffusion.py
examples/community/lpw_stable_diffusion.py
+1
-13
examples/community/lpw_stable_diffusion_onnx.py
examples/community/lpw_stable_diffusion_onnx.py
+1
-5
examples/dreambooth/train_dreambooth.py
examples/dreambooth/train_dreambooth.py
+1
-1
examples/dreambooth/train_dreambooth_flax.py
examples/dreambooth/train_dreambooth_flax.py
+1
-1
examples/dreambooth/train_dreambooth_lora.py
examples/dreambooth/train_dreambooth_lora.py
+1
-1
examples/text_to_image/train_text_to_image.py
examples/text_to_image/train_text_to_image.py
+1
-1
examples/text_to_image/train_text_to_image_flax.py
examples/text_to_image/train_text_to_image_flax.py
+1
-1
examples/text_to_image/train_text_to_image_lora.py
examples/text_to_image/train_text_to_image_lora.py
+1
-1
examples/textual_inversion/textual_inversion.py
examples/textual_inversion/textual_inversion.py
+1
-1
examples/textual_inversion/textual_inversion_flax.py
examples/textual_inversion/textual_inversion_flax.py
+1
-1
examples/unconditional_image_generation/train_unconditional.py
...les/unconditional_image_generation/train_unconditional.py
+1
-1
setup.py
setup.py
+1
-1
src/diffusers/__init__.py
src/diffusers/__init__.py
+1
-1
src/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion_superresolution.py
...nt_diffusion/pipeline_latent_diffusion_superresolution.py
+1
-6
src/diffusers/pipelines/stable_diffusion/pipeline_cycle_diffusion.py
...rs/pipelines/stable_diffusion/pipeline_cycle_diffusion.py
+0
-5
src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_img2img.py
...table_diffusion/pipeline_onnx_stable_diffusion_img2img.py
+0
-5
src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_inpaint_legacy.py
...iffusion/pipeline_onnx_stable_diffusion_inpaint_legacy.py
+0
-5
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py
...nes/stable_diffusion/pipeline_stable_diffusion_img2img.py
+0
-5
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint_legacy.py
...ble_diffusion/pipeline_stable_diffusion_inpaint_legacy.py
+0
-5
No files found.
examples/community/imagic_stable_diffusion.py
View file @
3231712b
...
@@ -22,7 +22,7 @@ from diffusers.models import AutoencoderKL, UNet2DConditionModel
...
@@ -22,7 +22,7 @@ from diffusers.models import AutoencoderKL, UNet2DConditionModel
from
diffusers.pipelines.stable_diffusion
import
StableDiffusionPipelineOutput
from
diffusers.pipelines.stable_diffusion
import
StableDiffusionPipelineOutput
from
diffusers.pipelines.stable_diffusion.safety_checker
import
StableDiffusionSafetyChecker
from
diffusers.pipelines.stable_diffusion.safety_checker
import
StableDiffusionSafetyChecker
from
diffusers.schedulers
import
DDIMScheduler
,
LMSDiscreteScheduler
,
PNDMScheduler
from
diffusers.schedulers
import
DDIMScheduler
,
LMSDiscreteScheduler
,
PNDMScheduler
from
diffusers.utils
import
deprecate
,
logging
from
diffusers.utils
import
logging
if
version
.
parse
(
version
.
parse
(
PIL
.
__version__
).
base_version
)
>=
version
.
parse
(
"9.1.0"
):
if
version
.
parse
(
version
.
parse
(
PIL
.
__version__
).
base_version
)
>=
version
.
parse
(
"9.1.0"
):
...
@@ -184,10 +184,6 @@ class ImagicStableDiffusionPipeline(DiffusionPipeline):
...
@@ -184,10 +184,6 @@ class ImagicStableDiffusionPipeline(DiffusionPipeline):
list of `bool`s denoting whether the corresponding generated image likely represents "not-safe-for-work"
list of `bool`s denoting whether the corresponding generated image likely represents "not-safe-for-work"
(nsfw) content, according to the `safety_checker`.
(nsfw) content, according to the `safety_checker`.
"""
"""
message
=
"Please use `image` instead of `init_image`."
init_image
=
deprecate
(
"init_image"
,
"0.14.0"
,
message
,
take_from
=
kwargs
)
image
=
init_image
or
image
accelerator
=
Accelerator
(
accelerator
=
Accelerator
(
gradient_accumulation_steps
=
1
,
gradient_accumulation_steps
=
1
,
mixed_precision
=
"fp16"
,
mixed_precision
=
"fp16"
,
...
@@ -346,7 +342,6 @@ class ImagicStableDiffusionPipeline(DiffusionPipeline):
...
@@ -346,7 +342,6 @@ class ImagicStableDiffusionPipeline(DiffusionPipeline):
return_dict
:
bool
=
True
,
return_dict
:
bool
=
True
,
guidance_scale
:
float
=
7.5
,
guidance_scale
:
float
=
7.5
,
eta
:
float
=
0.0
,
eta
:
float
=
0.0
,
**
kwargs
,
):
):
r
"""
r
"""
Function invoked when calling the pipeline for generation.
Function invoked when calling the pipeline for generation.
...
...
examples/community/lpw_stable_diffusion.py
View file @
3231712b
...
@@ -12,7 +12,7 @@ import diffusers
...
@@ -12,7 +12,7 @@ import diffusers
from
diffusers
import
SchedulerMixin
,
StableDiffusionPipeline
from
diffusers
import
SchedulerMixin
,
StableDiffusionPipeline
from
diffusers.models
import
AutoencoderKL
,
UNet2DConditionModel
from
diffusers.models
import
AutoencoderKL
,
UNet2DConditionModel
from
diffusers.pipelines.stable_diffusion
import
StableDiffusionPipelineOutput
,
StableDiffusionSafetyChecker
from
diffusers.pipelines.stable_diffusion
import
StableDiffusionPipelineOutput
,
StableDiffusionSafetyChecker
from
diffusers.utils
import
deprecate
,
logging
from
diffusers.utils
import
logging
try
:
try
:
...
@@ -252,7 +252,6 @@ def get_weighted_text_embeddings(
...
@@ -252,7 +252,6 @@ def get_weighted_text_embeddings(
no_boseos_middle
:
Optional
[
bool
]
=
False
,
no_boseos_middle
:
Optional
[
bool
]
=
False
,
skip_parsing
:
Optional
[
bool
]
=
False
,
skip_parsing
:
Optional
[
bool
]
=
False
,
skip_weighting
:
Optional
[
bool
]
=
False
,
skip_weighting
:
Optional
[
bool
]
=
False
,
**
kwargs
,
):
):
r
"""
r
"""
Prompts can be assigned with local weights using brackets. For example,
Prompts can be assigned with local weights using brackets. For example,
...
@@ -682,7 +681,6 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
...
@@ -682,7 +681,6 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
is_cancelled_callback
:
Optional
[
Callable
[[],
bool
]]
=
None
,
is_cancelled_callback
:
Optional
[
Callable
[[],
bool
]]
=
None
,
callback_steps
:
int
=
1
,
callback_steps
:
int
=
1
,
**
kwargs
,
):
):
r
"""
r
"""
Function invoked when calling the pipeline for generation.
Function invoked when calling the pipeline for generation.
...
@@ -758,10 +756,6 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
...
@@ -758,10 +756,6 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
list of `bool`s denoting whether the corresponding generated image likely represents "not-safe-for-work"
list of `bool`s denoting whether the corresponding generated image likely represents "not-safe-for-work"
(nsfw) content, according to the `safety_checker`.
(nsfw) content, according to the `safety_checker`.
"""
"""
message
=
"Please use `image` instead of `init_image`."
init_image
=
deprecate
(
"init_image"
,
"0.14.0"
,
message
,
take_from
=
kwargs
)
image
=
init_image
or
image
# 0. Default height and width to unet
# 0. Default height and width to unet
height
=
height
or
self
.
unet
.
config
.
sample_size
*
self
.
vae_scale_factor
height
=
height
or
self
.
unet
.
config
.
sample_size
*
self
.
vae_scale_factor
width
=
width
or
self
.
unet
.
config
.
sample_size
*
self
.
vae_scale_factor
width
=
width
or
self
.
unet
.
config
.
sample_size
*
self
.
vae_scale_factor
...
@@ -884,7 +878,6 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
...
@@ -884,7 +878,6 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
is_cancelled_callback
:
Optional
[
Callable
[[],
bool
]]
=
None
,
is_cancelled_callback
:
Optional
[
Callable
[[],
bool
]]
=
None
,
callback_steps
:
int
=
1
,
callback_steps
:
int
=
1
,
**
kwargs
,
):
):
r
"""
r
"""
Function for text-to-image generation.
Function for text-to-image generation.
...
@@ -960,7 +953,6 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
...
@@ -960,7 +953,6 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
callback
=
callback
,
callback
=
callback
,
is_cancelled_callback
=
is_cancelled_callback
,
is_cancelled_callback
=
is_cancelled_callback
,
callback_steps
=
callback_steps
,
callback_steps
=
callback_steps
,
**
kwargs
,
)
)
def
img2img
(
def
img2img
(
...
@@ -980,7 +972,6 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
...
@@ -980,7 +972,6 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
is_cancelled_callback
:
Optional
[
Callable
[[],
bool
]]
=
None
,
is_cancelled_callback
:
Optional
[
Callable
[[],
bool
]]
=
None
,
callback_steps
:
int
=
1
,
callback_steps
:
int
=
1
,
**
kwargs
,
):
):
r
"""
r
"""
Function for image-to-image generation.
Function for image-to-image generation.
...
@@ -1056,7 +1047,6 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
...
@@ -1056,7 +1047,6 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
callback
=
callback
,
callback
=
callback
,
is_cancelled_callback
=
is_cancelled_callback
,
is_cancelled_callback
=
is_cancelled_callback
,
callback_steps
=
callback_steps
,
callback_steps
=
callback_steps
,
**
kwargs
,
)
)
def
inpaint
(
def
inpaint
(
...
@@ -1077,7 +1067,6 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
...
@@ -1077,7 +1067,6 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
is_cancelled_callback
:
Optional
[
Callable
[[],
bool
]]
=
None
,
is_cancelled_callback
:
Optional
[
Callable
[[],
bool
]]
=
None
,
callback_steps
:
int
=
1
,
callback_steps
:
int
=
1
,
**
kwargs
,
):
):
r
"""
r
"""
Function for inpaint.
Function for inpaint.
...
@@ -1158,5 +1147,4 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
...
@@ -1158,5 +1147,4 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
callback
=
callback
,
callback
=
callback
,
is_cancelled_callback
=
is_cancelled_callback
,
is_cancelled_callback
=
is_cancelled_callback
,
callback_steps
=
callback_steps
,
callback_steps
=
callback_steps
,
**
kwargs
,
)
)
examples/community/lpw_stable_diffusion_onnx.py
View file @
3231712b
...
@@ -11,7 +11,7 @@ from transformers import CLIPFeatureExtractor, CLIPTokenizer
...
@@ -11,7 +11,7 @@ from transformers import CLIPFeatureExtractor, CLIPTokenizer
import
diffusers
import
diffusers
from
diffusers
import
OnnxRuntimeModel
,
OnnxStableDiffusionPipeline
,
SchedulerMixin
from
diffusers
import
OnnxRuntimeModel
,
OnnxStableDiffusionPipeline
,
SchedulerMixin
from
diffusers.pipelines.stable_diffusion
import
StableDiffusionPipelineOutput
from
diffusers.pipelines.stable_diffusion
import
StableDiffusionPipelineOutput
from
diffusers.utils
import
deprecate
,
logging
from
diffusers.utils
import
logging
try
:
try
:
...
@@ -744,10 +744,6 @@ class OnnxStableDiffusionLongPromptWeightingPipeline(OnnxStableDiffusionPipeline
...
@@ -744,10 +744,6 @@ class OnnxStableDiffusionLongPromptWeightingPipeline(OnnxStableDiffusionPipeline
list of `bool`s denoting whether the corresponding generated image likely represents "not-safe-for-work"
list of `bool`s denoting whether the corresponding generated image likely represents "not-safe-for-work"
(nsfw) content, according to the `safety_checker`.
(nsfw) content, according to the `safety_checker`.
"""
"""
message
=
"Please use `image` instead of `init_image`."
init_image
=
deprecate
(
"init_image"
,
"0.14.0"
,
message
,
take_from
=
kwargs
)
image
=
init_image
or
image
# 0. Default height and width to unet
# 0. Default height and width to unet
height
=
height
or
self
.
unet
.
config
.
sample_size
*
self
.
vae_scale_factor
height
=
height
or
self
.
unet
.
config
.
sample_size
*
self
.
vae_scale_factor
width
=
width
or
self
.
unet
.
config
.
sample_size
*
self
.
vae_scale_factor
width
=
width
or
self
.
unet
.
config
.
sample_size
*
self
.
vae_scale_factor
...
...
examples/dreambooth/train_dreambooth.py
View file @
3231712b
...
@@ -47,7 +47,7 @@ from diffusers.utils.import_utils import is_xformers_available
...
@@ -47,7 +47,7 @@ from diffusers.utils.import_utils import is_xformers_available
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version
(
"0.1
3.
0"
)
check_min_version
(
"0.1
4.0.dev
0"
)
logger
=
get_logger
(
__name__
)
logger
=
get_logger
(
__name__
)
...
...
examples/dreambooth/train_dreambooth_flax.py
View file @
3231712b
...
@@ -36,7 +36,7 @@ from diffusers.utils import check_min_version
...
@@ -36,7 +36,7 @@ from diffusers.utils import check_min_version
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version
(
"0.1
3.
0"
)
check_min_version
(
"0.1
4.0.dev
0"
)
# Cache compiled models across invocations of this script.
# Cache compiled models across invocations of this script.
cc
.
initialize_cache
(
os
.
path
.
expanduser
(
"~/.cache/jax/compilation_cache"
))
cc
.
initialize_cache
(
os
.
path
.
expanduser
(
"~/.cache/jax/compilation_cache"
))
...
...
examples/dreambooth/train_dreambooth_lora.py
View file @
3231712b
...
@@ -54,7 +54,7 @@ from diffusers.utils.import_utils import is_xformers_available
...
@@ -54,7 +54,7 @@ from diffusers.utils.import_utils import is_xformers_available
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version
(
"0.1
3.
0"
)
check_min_version
(
"0.1
4.0.dev
0"
)
logger
=
get_logger
(
__name__
)
logger
=
get_logger
(
__name__
)
...
...
examples/text_to_image/train_text_to_image.py
View file @
3231712b
...
@@ -47,7 +47,7 @@ from diffusers.utils.import_utils import is_xformers_available
...
@@ -47,7 +47,7 @@ from diffusers.utils.import_utils import is_xformers_available
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version
(
"0.1
3.
0"
)
check_min_version
(
"0.1
4.0.dev
0"
)
logger
=
get_logger
(
__name__
,
log_level
=
"INFO"
)
logger
=
get_logger
(
__name__
,
log_level
=
"INFO"
)
...
...
examples/text_to_image/train_text_to_image_flax.py
View file @
3231712b
...
@@ -34,7 +34,7 @@ from diffusers.utils import check_min_version
...
@@ -34,7 +34,7 @@ from diffusers.utils import check_min_version
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version
(
"0.1
3.
0"
)
check_min_version
(
"0.1
4.0.dev
0"
)
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
...
...
examples/text_to_image/train_text_to_image_lora.py
View file @
3231712b
...
@@ -48,7 +48,7 @@ from diffusers.utils.import_utils import is_xformers_available
...
@@ -48,7 +48,7 @@ from diffusers.utils.import_utils import is_xformers_available
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version
(
"0.1
3.
0"
)
check_min_version
(
"0.1
4.0.dev
0"
)
logger
=
get_logger
(
__name__
,
log_level
=
"INFO"
)
logger
=
get_logger
(
__name__
,
log_level
=
"INFO"
)
...
...
examples/textual_inversion/textual_inversion.py
View file @
3231712b
...
@@ -74,7 +74,7 @@ else:
...
@@ -74,7 +74,7 @@ else:
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version
(
"0.1
3.
0"
)
check_min_version
(
"0.1
4.0.dev
0"
)
logger
=
get_logger
(
__name__
)
logger
=
get_logger
(
__name__
)
...
...
examples/textual_inversion/textual_inversion_flax.py
View file @
3231712b
...
@@ -57,7 +57,7 @@ else:
...
@@ -57,7 +57,7 @@ else:
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version
(
"0.1
3.
0"
)
check_min_version
(
"0.1
4.0.dev
0"
)
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
...
...
examples/unconditional_image_generation/train_unconditional.py
View file @
3231712b
...
@@ -27,7 +27,7 @@ from diffusers.utils import check_min_version, is_tensorboard_available, is_wand
...
@@ -27,7 +27,7 @@ from diffusers.utils import check_min_version, is_tensorboard_available, is_wand
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version
(
"0.1
3.
0"
)
check_min_version
(
"0.1
4.0.dev
0"
)
logger
=
get_logger
(
__name__
,
log_level
=
"INFO"
)
logger
=
get_logger
(
__name__
,
log_level
=
"INFO"
)
...
...
setup.py
View file @
3231712b
...
@@ -219,7 +219,7 @@ install_requires = [
...
@@ -219,7 +219,7 @@ install_requires = [
setup
(
setup
(
name
=
"diffusers"
,
name
=
"diffusers"
,
version
=
"0.1
3.
0"
,
# expected format is one of x.y.z.dev0, or x.y.z.rc1 or x.y.z (no to dashes, yes to dots)
version
=
"0.1
4.0.dev
0"
,
# expected format is one of x.y.z.dev0, or x.y.z.rc1 or x.y.z (no to dashes, yes to dots)
description
=
"Diffusers"
,
description
=
"Diffusers"
,
long_description
=
open
(
"README.md"
,
"r"
,
encoding
=
"utf-8"
).
read
(),
long_description
=
open
(
"README.md"
,
"r"
,
encoding
=
"utf-8"
).
read
(),
long_description_content_type
=
"text/markdown"
,
long_description_content_type
=
"text/markdown"
,
...
...
src/diffusers/__init__.py
View file @
3231712b
__version__
=
"0.1
3.
0"
__version__
=
"0.1
4.0.dev
0"
from
.configuration_utils
import
ConfigMixin
from
.configuration_utils
import
ConfigMixin
from
.utils
import
(
from
.utils
import
(
...
...
src/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion_superresolution.py
View file @
3231712b
...
@@ -15,7 +15,7 @@ from ...schedulers import (
...
@@ -15,7 +15,7 @@ from ...schedulers import (
LMSDiscreteScheduler
,
LMSDiscreteScheduler
,
PNDMScheduler
,
PNDMScheduler
,
)
)
from
...utils
import
PIL_INTERPOLATION
,
deprecate
,
randn_tensor
from
...utils
import
PIL_INTERPOLATION
,
randn_tensor
from
..pipeline_utils
import
DiffusionPipeline
,
ImagePipelineOutput
from
..pipeline_utils
import
DiffusionPipeline
,
ImagePipelineOutput
...
@@ -72,7 +72,6 @@ class LDMSuperResolutionPipeline(DiffusionPipeline):
...
@@ -72,7 +72,6 @@ class LDMSuperResolutionPipeline(DiffusionPipeline):
generator
:
Optional
[
Union
[
torch
.
Generator
,
List
[
torch
.
Generator
]]]
=
None
,
generator
:
Optional
[
Union
[
torch
.
Generator
,
List
[
torch
.
Generator
]]]
=
None
,
output_type
:
Optional
[
str
]
=
"pil"
,
output_type
:
Optional
[
str
]
=
"pil"
,
return_dict
:
bool
=
True
,
return_dict
:
bool
=
True
,
**
kwargs
,
)
->
Union
[
Tuple
,
ImagePipelineOutput
]:
)
->
Union
[
Tuple
,
ImagePipelineOutput
]:
r
"""
r
"""
Args:
Args:
...
@@ -100,10 +99,6 @@ class LDMSuperResolutionPipeline(DiffusionPipeline):
...
@@ -100,10 +99,6 @@ class LDMSuperResolutionPipeline(DiffusionPipeline):
[`~pipelines.ImagePipelineOutput`] or `tuple`: [`~pipelines.utils.ImagePipelineOutput`] if `return_dict` is
[`~pipelines.ImagePipelineOutput`] or `tuple`: [`~pipelines.utils.ImagePipelineOutput`] if `return_dict` is
True, otherwise a `tuple. When returning a tuple, the first element is a list with the generated images.
True, otherwise a `tuple. When returning a tuple, the first element is a list with the generated images.
"""
"""
message
=
"Please use `image` instead of `init_image`."
init_image
=
deprecate
(
"init_image"
,
"0.14.0"
,
message
,
take_from
=
kwargs
)
image
=
init_image
or
image
if
isinstance
(
image
,
PIL
.
Image
.
Image
):
if
isinstance
(
image
,
PIL
.
Image
.
Image
):
batch_size
=
1
batch_size
=
1
elif
isinstance
(
image
,
torch
.
Tensor
):
elif
isinstance
(
image
,
torch
.
Tensor
):
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_cycle_diffusion.py
View file @
3231712b
...
@@ -582,7 +582,6 @@ class CycleDiffusionPipeline(DiffusionPipeline):
...
@@ -582,7 +582,6 @@ class CycleDiffusionPipeline(DiffusionPipeline):
return_dict
:
bool
=
True
,
return_dict
:
bool
=
True
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback_steps
:
int
=
1
,
callback_steps
:
int
=
1
,
**
kwargs
,
):
):
r
"""
r
"""
Function invoked when calling the pipeline for generation.
Function invoked when calling the pipeline for generation.
...
@@ -646,10 +645,6 @@ class CycleDiffusionPipeline(DiffusionPipeline):
...
@@ -646,10 +645,6 @@ class CycleDiffusionPipeline(DiffusionPipeline):
list of `bool`s denoting whether the corresponding generated image likely represents "not-safe-for-work"
list of `bool`s denoting whether the corresponding generated image likely represents "not-safe-for-work"
(nsfw) content, according to the `safety_checker`.
(nsfw) content, according to the `safety_checker`.
"""
"""
message
=
"Please use `image` instead of `init_image`."
init_image
=
deprecate
(
"init_image"
,
"0.14.0"
,
message
,
take_from
=
kwargs
)
image
=
init_image
or
image
# 1. Check inputs
# 1. Check inputs
self
.
check_inputs
(
prompt
,
strength
,
callback_steps
)
self
.
check_inputs
(
prompt
,
strength
,
callback_steps
)
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_img2img.py
View file @
3231712b
...
@@ -253,7 +253,6 @@ class OnnxStableDiffusionImg2ImgPipeline(DiffusionPipeline):
...
@@ -253,7 +253,6 @@ class OnnxStableDiffusionImg2ImgPipeline(DiffusionPipeline):
return_dict
:
bool
=
True
,
return_dict
:
bool
=
True
,
callback
:
Optional
[
Callable
[[
int
,
int
,
np
.
ndarray
],
None
]]
=
None
,
callback
:
Optional
[
Callable
[[
int
,
int
,
np
.
ndarray
],
None
]]
=
None
,
callback_steps
:
int
=
1
,
callback_steps
:
int
=
1
,
**
kwargs
,
):
):
r
"""
r
"""
Function invoked when calling the pipeline for generation.
Function invoked when calling the pipeline for generation.
...
@@ -309,10 +308,6 @@ class OnnxStableDiffusionImg2ImgPipeline(DiffusionPipeline):
...
@@ -309,10 +308,6 @@ class OnnxStableDiffusionImg2ImgPipeline(DiffusionPipeline):
list of `bool`s denoting whether the corresponding generated image likely represents "not-safe-for-work"
list of `bool`s denoting whether the corresponding generated image likely represents "not-safe-for-work"
(nsfw) content, according to the `safety_checker`.
(nsfw) content, according to the `safety_checker`.
"""
"""
message
=
"Please use `image` instead of `init_image`."
init_image
=
deprecate
(
"init_image"
,
"0.14.0"
,
message
,
take_from
=
kwargs
)
image
=
init_image
or
image
if
isinstance
(
prompt
,
str
):
if
isinstance
(
prompt
,
str
):
batch_size
=
1
batch_size
=
1
elif
isinstance
(
prompt
,
list
):
elif
isinstance
(
prompt
,
list
):
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_inpaint_legacy.py
View file @
3231712b
...
@@ -240,7 +240,6 @@ class OnnxStableDiffusionInpaintPipelineLegacy(DiffusionPipeline):
...
@@ -240,7 +240,6 @@ class OnnxStableDiffusionInpaintPipelineLegacy(DiffusionPipeline):
return_dict
:
bool
=
True
,
return_dict
:
bool
=
True
,
callback
:
Optional
[
Callable
[[
int
,
int
,
np
.
ndarray
],
None
]]
=
None
,
callback
:
Optional
[
Callable
[[
int
,
int
,
np
.
ndarray
],
None
]]
=
None
,
callback_steps
:
int
=
1
,
callback_steps
:
int
=
1
,
**
kwargs
,
):
):
r
"""
r
"""
Function invoked when calling the pipeline for generation.
Function invoked when calling the pipeline for generation.
...
@@ -301,10 +300,6 @@ class OnnxStableDiffusionInpaintPipelineLegacy(DiffusionPipeline):
...
@@ -301,10 +300,6 @@ class OnnxStableDiffusionInpaintPipelineLegacy(DiffusionPipeline):
list of `bool`s denoting whether the corresponding generated image likely represents "not-safe-for-work"
list of `bool`s denoting whether the corresponding generated image likely represents "not-safe-for-work"
(nsfw) content, according to the `safety_checker`.
(nsfw) content, according to the `safety_checker`.
"""
"""
message
=
"Please use `image` instead of `init_image`."
init_image
=
deprecate
(
"init_image"
,
"0.14.0"
,
message
,
take_from
=
kwargs
)
image
=
init_image
or
image
if
isinstance
(
prompt
,
str
):
if
isinstance
(
prompt
,
str
):
batch_size
=
1
batch_size
=
1
elif
isinstance
(
prompt
,
list
):
elif
isinstance
(
prompt
,
list
):
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py
View file @
3231712b
...
@@ -572,7 +572,6 @@ class StableDiffusionImg2ImgPipeline(DiffusionPipeline):
...
@@ -572,7 +572,6 @@ class StableDiffusionImg2ImgPipeline(DiffusionPipeline):
return_dict
:
bool
=
True
,
return_dict
:
bool
=
True
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback_steps
:
int
=
1
,
callback_steps
:
int
=
1
,
**
kwargs
,
):
):
r
"""
r
"""
Function invoked when calling the pipeline for generation.
Function invoked when calling the pipeline for generation.
...
@@ -639,10 +638,6 @@ class StableDiffusionImg2ImgPipeline(DiffusionPipeline):
...
@@ -639,10 +638,6 @@ class StableDiffusionImg2ImgPipeline(DiffusionPipeline):
list of `bool`s denoting whether the corresponding generated image likely represents "not-safe-for-work"
list of `bool`s denoting whether the corresponding generated image likely represents "not-safe-for-work"
(nsfw) content, according to the `safety_checker`.
(nsfw) content, according to the `safety_checker`.
"""
"""
message
=
"Please use `image` instead of `init_image`."
init_image
=
deprecate
(
"init_image"
,
"0.14.0"
,
message
,
take_from
=
kwargs
)
image
=
init_image
or
image
# 1. Check inputs. Raise error if not correct
# 1. Check inputs. Raise error if not correct
self
.
check_inputs
(
prompt
,
strength
,
callback_steps
,
negative_prompt
,
prompt_embeds
,
negative_prompt_embeds
)
self
.
check_inputs
(
prompt
,
strength
,
callback_steps
,
negative_prompt
,
prompt_embeds
,
negative_prompt_embeds
)
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint_legacy.py
View file @
3231712b
...
@@ -530,7 +530,6 @@ class StableDiffusionInpaintPipelineLegacy(DiffusionPipeline):
...
@@ -530,7 +530,6 @@ class StableDiffusionInpaintPipelineLegacy(DiffusionPipeline):
return_dict
:
bool
=
True
,
return_dict
:
bool
=
True
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback_steps
:
int
=
1
,
callback_steps
:
int
=
1
,
**
kwargs
,
):
):
r
"""
r
"""
Function invoked when calling the pipeline for generation.
Function invoked when calling the pipeline for generation.
...
@@ -603,10 +602,6 @@ class StableDiffusionInpaintPipelineLegacy(DiffusionPipeline):
...
@@ -603,10 +602,6 @@ class StableDiffusionInpaintPipelineLegacy(DiffusionPipeline):
list of `bool`s denoting whether the corresponding generated image likely represents "not-safe-for-work"
list of `bool`s denoting whether the corresponding generated image likely represents "not-safe-for-work"
(nsfw) content, according to the `safety_checker`.
(nsfw) content, according to the `safety_checker`.
"""
"""
message
=
"Please use `image` instead of `init_image`."
init_image
=
deprecate
(
"init_image"
,
"0.14.0"
,
message
,
take_from
=
kwargs
)
image
=
init_image
or
image
# 1. Check inputs
# 1. Check inputs
self
.
check_inputs
(
prompt
,
strength
,
callback_steps
)
self
.
check_inputs
(
prompt
,
strength
,
callback_steps
)
...
...
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