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
09779cbb
Unverified
Commit
09779cbb
authored
Jan 25, 2023
by
Patrick von Platen
Committed by
GitHub
Jan 25, 2023
Browse files
[Bump version] 0.13.0dev0 & Deprecate `predict_epsilon` (#2109)
* [Bump version] 0.13 * Bump model up * up
parent
b0cc7c20
Changes
33
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
20 additions
and
46 deletions
+20
-46
examples/community/imagic_stable_diffusion.py
examples/community/imagic_stable_diffusion.py
+1
-1
examples/community/lpw_stable_diffusion.py
examples/community/lpw_stable_diffusion.py
+1
-1
examples/community/lpw_stable_diffusion_onnx.py
examples/community/lpw_stable_diffusion_onnx.py
+1
-1
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
examples/unconditional_image_generation/train_unconditional_ort.py
...unconditional_image_generation/train_unconditional_ort.py
+1
-1
setup.py
setup.py
+1
-1
src/diffusers/__init__.py
src/diffusers/__init__.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/ddpm/pipeline_ddpm.py
src/diffusers/pipelines/ddpm/pipeline_ddpm.py
+1
-27
src/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion_superresolution.py
...nt_diffusion/pipeline_latent_diffusion_superresolution.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_onnx_stable_diffusion_img2img.py
...table_diffusion/pipeline_onnx_stable_diffusion_img2img.py
+1
-1
No files found.
examples/community/imagic_stable_diffusion.py
View file @
09779cbb
...
...
@@ -185,7 +185,7 @@ class ImagicStableDiffusionPipeline(DiffusionPipeline):
(nsfw) content, according to the `safety_checker`.
"""
message
=
"Please use `image` instead of `init_image`."
init_image
=
deprecate
(
"init_image"
,
"0.1
3
.0"
,
message
,
take_from
=
kwargs
)
init_image
=
deprecate
(
"init_image"
,
"0.1
4
.0"
,
message
,
take_from
=
kwargs
)
image
=
init_image
or
image
accelerator
=
Accelerator
(
...
...
examples/community/lpw_stable_diffusion.py
View file @
09779cbb
...
...
@@ -759,7 +759,7 @@ class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
(nsfw) content, according to the `safety_checker`.
"""
message
=
"Please use `image` instead of `init_image`."
init_image
=
deprecate
(
"init_image"
,
"0.1
3
.0"
,
message
,
take_from
=
kwargs
)
init_image
=
deprecate
(
"init_image"
,
"0.1
4
.0"
,
message
,
take_from
=
kwargs
)
image
=
init_image
or
image
# 0. Default height and width to unet
...
...
examples/community/lpw_stable_diffusion_onnx.py
View file @
09779cbb
...
...
@@ -745,7 +745,7 @@ class OnnxStableDiffusionLongPromptWeightingPipeline(OnnxStableDiffusionPipeline
(nsfw) content, according to the `safety_checker`.
"""
message
=
"Please use `image` instead of `init_image`."
init_image
=
deprecate
(
"init_image"
,
"0.1
3
.0"
,
message
,
take_from
=
kwargs
)
init_image
=
deprecate
(
"init_image"
,
"0.1
4
.0"
,
message
,
take_from
=
kwargs
)
image
=
init_image
or
image
# 0. Default height and width to unet
...
...
examples/dreambooth/train_dreambooth.py
View file @
09779cbb
...
...
@@ -46,7 +46,7 @@ from transformers import AutoTokenizer, PretrainedConfig
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version
(
"0.1
2.
0"
)
check_min_version
(
"0.1
3.0.dev
0"
)
logger
=
get_logger
(
__name__
)
...
...
examples/dreambooth/train_dreambooth_flax.py
View file @
09779cbb
...
...
@@ -36,7 +36,7 @@ from transformers import CLIPFeatureExtractor, CLIPTokenizer, FlaxCLIPTextModel,
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version
(
"0.1
2.
0"
)
check_min_version
(
"0.1
3.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 @
09779cbb
...
...
@@ -54,7 +54,7 @@ from transformers import AutoTokenizer, PretrainedConfig
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version
(
"0.1
2.
0"
)
check_min_version
(
"0.1
3.0.dev
0"
)
logger
=
get_logger
(
__name__
)
...
...
examples/text_to_image/train_text_to_image.py
View file @
09779cbb
...
...
@@ -45,7 +45,7 @@ from transformers import CLIPTextModel, CLIPTokenizer
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version
(
"0.1
2.
0"
)
check_min_version
(
"0.1
3.0.dev
0"
)
logger
=
get_logger
(
__name__
,
log_level
=
"INFO"
)
...
...
examples/text_to_image/train_text_to_image_flax.py
View file @
09779cbb
...
...
@@ -34,7 +34,7 @@ from transformers import CLIPFeatureExtractor, CLIPTokenizer, FlaxCLIPTextModel,
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version
(
"0.1
2.
0"
)
check_min_version
(
"0.1
3.0.dev
0"
)
logger
=
logging
.
getLogger
(
__name__
)
...
...
examples/text_to_image/train_text_to_image_lora.py
View file @
09779cbb
...
...
@@ -47,7 +47,7 @@ from transformers import CLIPTextModel, CLIPTokenizer
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version
(
"0.1
2.
0"
)
check_min_version
(
"0.1
3.0.dev
0"
)
logger
=
get_logger
(
__name__
,
log_level
=
"INFO"
)
...
...
examples/textual_inversion/textual_inversion.py
View file @
09779cbb
...
...
@@ -68,7 +68,7 @@ else:
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version
(
"0.1
2.
0"
)
check_min_version
(
"0.1
3.0.dev
0"
)
logger
=
get_logger
(
__name__
)
...
...
examples/textual_inversion/textual_inversion_flax.py
View file @
09779cbb
...
...
@@ -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
2.
0"
)
check_min_version
(
"0.1
3.0.dev
0"
)
logger
=
logging
.
getLogger
(
__name__
)
...
...
examples/unconditional_image_generation/train_unconditional.py
View file @
09779cbb
...
...
@@ -33,7 +33,7 @@ from tqdm.auto import tqdm
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version
(
"0.1
2.
0"
)
check_min_version
(
"0.1
3.0.dev
0"
)
logger
=
get_logger
(
__name__
,
log_level
=
"INFO"
)
...
...
examples/unconditional_image_generation/train_unconditional_ort.py
View file @
09779cbb
...
...
@@ -30,7 +30,7 @@ from tqdm.auto import tqdm
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version
(
"0.1
2.
0"
)
check_min_version
(
"0.1
3.0.dev
0"
)
logger
=
get_logger
(
__name__
)
...
...
setup.py
View file @
09779cbb
...
...
@@ -219,7 +219,7 @@ install_requires = [
setup
(
name
=
"diffusers"
,
version
=
"0.1
2.
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
3.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 @
09779cbb
__version__
=
"0.1
2.
0"
__version__
=
"0.1
3.0.dev
0"
from
.configuration_utils
import
ConfigMixin
from
.utils
import
(
...
...
src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion_img2img.py
View file @
09779cbb
...
...
@@ -606,7 +606,7 @@ class AltDiffusionImg2ImgPipeline(DiffusionPipeline):
(nsfw) content, according to the `safety_checker`.
"""
message
=
"Please use `image` instead of `init_image`."
init_image
=
deprecate
(
"init_image"
,
"0.1
3
.0"
,
message
,
take_from
=
kwargs
)
init_image
=
deprecate
(
"init_image"
,
"0.1
4
.0"
,
message
,
take_from
=
kwargs
)
image
=
init_image
or
image
# 1. Check inputs. Raise error if not correct
...
...
src/diffusers/pipelines/ddpm/pipeline_ddpm.py
View file @
09779cbb
...
...
@@ -17,8 +17,7 @@ from typing import List, Optional, Tuple, Union
import
torch
from
...configuration_utils
import
FrozenDict
from
...utils
import
deprecate
,
randn_tensor
from
...utils
import
randn_tensor
from
..pipeline_utils
import
DiffusionPipeline
,
ImagePipelineOutput
...
...
@@ -46,7 +45,6 @@ class DDPMPipeline(DiffusionPipeline):
num_inference_steps
:
int
=
1000
,
output_type
:
Optional
[
str
]
=
"pil"
,
return_dict
:
bool
=
True
,
**
kwargs
,
)
->
Union
[
ImagePipelineOutput
,
Tuple
]:
r
"""
Args:
...
...
@@ -68,30 +66,6 @@ class DDPMPipeline(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 make sure to instantiate your scheduler with `prediction_type` instead. E.g. `scheduler ="
" DDPMScheduler.from_pretrained(<model_id>, prediction_type='epsilon')`."
)
predict_epsilon
=
deprecate
(
"predict_epsilon"
,
"0.13.0"
,
message
,
take_from
=
kwargs
)
if
predict_epsilon
is
not
None
:
new_config
=
dict
(
self
.
scheduler
.
config
)
new_config
[
"prediction_type"
]
=
"epsilon"
if
predict_epsilon
else
"sample"
self
.
scheduler
.
_internal_dict
=
FrozenDict
(
new_config
)
if
generator
is
not
None
and
generator
.
device
.
type
!=
self
.
device
.
type
and
self
.
device
.
type
!=
"mps"
:
message
=
(
f
"The `generator` device is `
{
generator
.
device
}
` and does not match the pipeline "
f
"device `
{
self
.
device
}
`, so the `generator` will be ignored. "
f
'Please use `torch.Generator(device="
{
self
.
device
}
")` instead.'
)
deprecate
(
"generator.device == 'cpu'"
,
"0.13.0"
,
message
,
)
generator
=
None
# Sample gaussian noise to begin loop
if
isinstance
(
self
.
unet
.
sample_size
,
int
):
image_shape
=
(
batch_size
,
self
.
unet
.
in_channels
,
self
.
unet
.
sample_size
,
self
.
unet
.
sample_size
)
...
...
src/diffusers/pipelines/latent_diffusion/pipeline_latent_diffusion_superresolution.py
View file @
09779cbb
...
...
@@ -102,7 +102,7 @@ class LDMSuperResolutionPipeline(DiffusionPipeline):
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.1
3
.0"
,
message
,
take_from
=
kwargs
)
init_image
=
deprecate
(
"init_image"
,
"0.1
4
.0"
,
message
,
take_from
=
kwargs
)
image
=
init_image
or
image
if
isinstance
(
image
,
PIL
.
Image
.
Image
):
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_cycle_diffusion.py
View file @
09779cbb
...
...
@@ -623,7 +623,7 @@ class CycleDiffusionPipeline(DiffusionPipeline):
(nsfw) content, according to the `safety_checker`.
"""
message
=
"Please use `image` instead of `init_image`."
init_image
=
deprecate
(
"init_image"
,
"0.1
3
.0"
,
message
,
take_from
=
kwargs
)
init_image
=
deprecate
(
"init_image"
,
"0.1
4
.0"
,
message
,
take_from
=
kwargs
)
image
=
init_image
or
image
# 1. Check inputs
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_img2img.py
View file @
09779cbb
...
...
@@ -311,7 +311,7 @@ class OnnxStableDiffusionImg2ImgPipeline(DiffusionPipeline):
(nsfw) content, according to the `safety_checker`.
"""
message
=
"Please use `image` instead of `init_image`."
init_image
=
deprecate
(
"init_image"
,
"0.1
3
.0"
,
message
,
take_from
=
kwargs
)
init_image
=
deprecate
(
"init_image"
,
"0.1
4
.0"
,
message
,
take_from
=
kwargs
)
image
=
init_image
or
image
if
isinstance
(
prompt
,
str
):
...
...
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