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
OpenDAS
diffusers
Commits
3231712b
Commit
3231712b
authored
Feb 17, 2023
by
Patrick von Platen
Browse files
Post release 0.14
parent
b2c1e0d6
Changes
20
Show 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
from
diffusers.pipelines.stable_diffusion
import
StableDiffusionPipelineOutput
from
diffusers.pipelines.stable_diffusion.safety_checker
import
StableDiffusionSafetyChecker
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"
):
...
...
@@ -184,10 +184,6 @@ class ImagicStableDiffusionPipeline(DiffusionPipeline):
list of `bool`s denoting whether the corresponding generated image likely represents "not-safe-for-work"
(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
(
gradient_accumulation_steps
=
1
,
mixed_precision
=
"fp16"
,
...
...
@@ -346,7 +342,6 @@ class ImagicStableDiffusionPipeline(DiffusionPipeline):
return_dict
:
bool
=
True
,
guidance_scale
:
float
=
7.5
,
eta
:
float
=
0.0
,
**
kwargs
,
):
r
"""
Function invoked when calling the pipeline for generation.
...
...
examples/community/lpw_stable_diffusion.py
View file @
3231712b
...
...
@@ -12,7 +12,7 @@ import diffusers
from
diffusers
import
SchedulerMixin
,
StableDiffusionPipeline
from
diffusers.models
import
AutoencoderKL
,
UNet2DConditionModel
from
diffusers.pipelines.stable_diffusion
import
StableDiffusionPipelineOutput
,
StableDiffusionSafetyChecker
from
diffusers.utils
import
deprecate
,
logging
from
diffusers.utils
import
logging
try
:
...
...
@@ -252,7 +252,6 @@ def get_weighted_text_embeddings(
no_boseos_middle
:
Optional
[
bool
]
=
False
,
skip_parsing
:
Optional
[
bool
]
=
False
,
skip_weighting
:
Optional
[
bool
]
=
False
,
**
kwargs
,
):
r
"""
Prompts can be assigned with local weights using brackets. For example,
...
...
@@ -682,7 +681,6 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
is_cancelled_callback
:
Optional
[
Callable
[[],
bool
]]
=
None
,
callback_steps
:
int
=
1
,
**
kwargs
,
):
r
"""
Function invoked when calling the pipeline for generation.
...
...
@@ -758,10 +756,6 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
list of `bool`s denoting whether the corresponding generated image likely represents "not-safe-for-work"
(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
height
=
height
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):
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
is_cancelled_callback
:
Optional
[
Callable
[[],
bool
]]
=
None
,
callback_steps
:
int
=
1
,
**
kwargs
,
):
r
"""
Function for text-to-image generation.
...
...
@@ -960,7 +953,6 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
callback
=
callback
,
is_cancelled_callback
=
is_cancelled_callback
,
callback_steps
=
callback_steps
,
**
kwargs
,
)
def
img2img
(
...
...
@@ -980,7 +972,6 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
is_cancelled_callback
:
Optional
[
Callable
[[],
bool
]]
=
None
,
callback_steps
:
int
=
1
,
**
kwargs
,
):
r
"""
Function for image-to-image generation.
...
...
@@ -1056,7 +1047,6 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
callback
=
callback
,
is_cancelled_callback
=
is_cancelled_callback
,
callback_steps
=
callback_steps
,
**
kwargs
,
)
def
inpaint
(
...
...
@@ -1077,7 +1067,6 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
is_cancelled_callback
:
Optional
[
Callable
[[],
bool
]]
=
None
,
callback_steps
:
int
=
1
,
**
kwargs
,
):
r
"""
Function for inpaint.
...
...
@@ -1158,5 +1147,4 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
callback
=
callback
,
is_cancelled_callback
=
is_cancelled_callback
,
callback_steps
=
callback_steps
,
**
kwargs
,
)
examples/community/lpw_stable_diffusion_onnx.py
View file @
3231712b
...
...
@@ -11,7 +11,7 @@ from transformers import CLIPFeatureExtractor, CLIPTokenizer
import
diffusers
from
diffusers
import
OnnxRuntimeModel
,
OnnxStableDiffusionPipeline
,
SchedulerMixin
from
diffusers.pipelines.stable_diffusion
import
StableDiffusionPipelineOutput
from
diffusers.utils
import
deprecate
,
logging
from
diffusers.utils
import
logging
try
:
...
...
@@ -744,10 +744,6 @@ class OnnxStableDiffusionLongPromptWeightingPipeline(OnnxStableDiffusionPipeline
list of `bool`s denoting whether the corresponding generated image likely represents "not-safe-for-work"
(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
height
=
height
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
# 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__
)
...
...
examples/dreambooth/train_dreambooth_flax.py
View file @
3231712b
...
...
@@ -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.
check_min_version
(
"0.1
3.
0"
)
check_min_version
(
"0.1
4.0.dev
0"
)
# Cache compiled models across invocations of this script.
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
# 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__
)
...
...
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
# 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"
)
...
...
examples/text_to_image/train_text_to_image_flax.py
View file @
3231712b
...
...
@@ -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.
check_min_version
(
"0.1
3.
0"
)
check_min_version
(
"0.1
4.0.dev
0"
)
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
# 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"
)
...
...
examples/textual_inversion/textual_inversion.py
View file @
3231712b
...
...
@@ -74,7 +74,7 @@ else:
# 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__
)
...
...
examples/textual_inversion/textual_inversion_flax.py
View file @
3231712b
...
...
@@ -57,7 +57,7 @@ else:
# ------------------------------------------------------------------------------
# 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__
)
...
...
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
# 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"
)
...
...
setup.py
View file @
3231712b
...
...
@@ -219,7 +219,7 @@ install_requires = [
setup
(
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"
,
long_description
=
open
(
"README.md"
,
"r"
,
encoding
=
"utf-8"
).
read
(),
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
.utils
import
(
...
...
src/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion_superresolution.py
View file @
3231712b
...
...
@@ -15,7 +15,7 @@ from ...schedulers import (
LMSDiscreteScheduler
,
PNDMScheduler
,
)
from
...utils
import
PIL_INTERPOLATION
,
deprecate
,
randn_tensor
from
...utils
import
PIL_INTERPOLATION
,
randn_tensor
from
..pipeline_utils
import
DiffusionPipeline
,
ImagePipelineOutput
...
...
@@ -72,7 +72,6 @@ class LDMSuperResolutionPipeline(DiffusionPipeline):
generator
:
Optional
[
Union
[
torch
.
Generator
,
List
[
torch
.
Generator
]]]
=
None
,
output_type
:
Optional
[
str
]
=
"pil"
,
return_dict
:
bool
=
True
,
**
kwargs
,
)
->
Union
[
Tuple
,
ImagePipelineOutput
]:
r
"""
Args:
...
...
@@ -100,10 +99,6 @@ class LDMSuperResolutionPipeline(DiffusionPipeline):
[`~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.
"""
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
):
batch_size
=
1
elif
isinstance
(
image
,
torch
.
Tensor
):
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_cycle_diffusion.py
View file @
3231712b
...
...
@@ -582,7 +582,6 @@ class CycleDiffusionPipeline(DiffusionPipeline):
return_dict
:
bool
=
True
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback_steps
:
int
=
1
,
**
kwargs
,
):
r
"""
Function invoked when calling the pipeline for generation.
...
...
@@ -646,10 +645,6 @@ class CycleDiffusionPipeline(DiffusionPipeline):
list of `bool`s denoting whether the corresponding generated image likely represents "not-safe-for-work"
(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
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):
return_dict
:
bool
=
True
,
callback
:
Optional
[
Callable
[[
int
,
int
,
np
.
ndarray
],
None
]]
=
None
,
callback_steps
:
int
=
1
,
**
kwargs
,
):
r
"""
Function invoked when calling the pipeline for generation.
...
...
@@ -309,10 +308,6 @@ class OnnxStableDiffusionImg2ImgPipeline(DiffusionPipeline):
list of `bool`s denoting whether the corresponding generated image likely represents "not-safe-for-work"
(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
):
batch_size
=
1
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):
return_dict
:
bool
=
True
,
callback
:
Optional
[
Callable
[[
int
,
int
,
np
.
ndarray
],
None
]]
=
None
,
callback_steps
:
int
=
1
,
**
kwargs
,
):
r
"""
Function invoked when calling the pipeline for generation.
...
...
@@ -301,10 +300,6 @@ class OnnxStableDiffusionInpaintPipelineLegacy(DiffusionPipeline):
list of `bool`s denoting whether the corresponding generated image likely represents "not-safe-for-work"
(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
):
batch_size
=
1
elif
isinstance
(
prompt
,
list
):
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py
View file @
3231712b
...
...
@@ -572,7 +572,6 @@ class StableDiffusionImg2ImgPipeline(DiffusionPipeline):
return_dict
:
bool
=
True
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback_steps
:
int
=
1
,
**
kwargs
,
):
r
"""
Function invoked when calling the pipeline for generation.
...
...
@@ -639,10 +638,6 @@ class StableDiffusionImg2ImgPipeline(DiffusionPipeline):
list of `bool`s denoting whether the corresponding generated image likely represents "not-safe-for-work"
(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
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):
return_dict
:
bool
=
True
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback_steps
:
int
=
1
,
**
kwargs
,
):
r
"""
Function invoked when calling the pipeline for generation.
...
...
@@ -603,10 +602,6 @@ class StableDiffusionInpaintPipelineLegacy(DiffusionPipeline):
list of `bool`s denoting whether the corresponding generated image likely represents "not-safe-for-work"
(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
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