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
2fcae69f
Unverified
Commit
2fcae69f
authored
Nov 04, 2022
by
Anton Lozhkov
Committed by
GitHub
Nov 04, 2022
Browse files
Bump to 0.8.0.dev0 (#1131)
* Bump to 0.8.0.dev0 * deprecate int timesteps * style
parent
a4802294
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
60 deletions
+9
-60
setup.py
setup.py
+1
-1
src/diffusers/__init__.py
src/diffusers/__init__.py
+1
-1
src/diffusers/schedulers/scheduling_euler_ancestral_discrete.py
...ffusers/schedulers/scheduling_euler_ancestral_discrete.py
+2
-14
src/diffusers/schedulers/scheduling_euler_discrete.py
src/diffusers/schedulers/scheduling_euler_discrete.py
+2
-14
src/diffusers/schedulers/scheduling_lms_discrete.py
src/diffusers/schedulers/scheduling_lms_discrete.py
+3
-30
No files found.
setup.py
View file @
2fcae69f
...
...
@@ -210,7 +210,7 @@ install_requires = [
setup
(
name
=
"diffusers"
,
version
=
"0.
7.
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.
8.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 @
2fcae69f
...
...
@@ -9,7 +9,7 @@ from .utils import (
)
__version__
=
"0.
7.
0"
__version__
=
"0.
8.0.dev
0"
from
.configuration_utils
import
ConfigMixin
from
.onnx_utils
import
OnnxRuntimeModel
...
...
src/diffusers/schedulers/scheduling_euler_ancestral_discrete.py
View file @
2fcae69f
...
...
@@ -19,7 +19,7 @@ import numpy as np
import
torch
from
..configuration_utils
import
ConfigMixin
,
register_to_config
from
..utils
import
BaseOutput
,
deprecate
,
logging
from
..utils
import
BaseOutput
,
logging
from
.scheduling_utils
import
SchedulerMixin
...
...
@@ -253,19 +253,7 @@ class EulerAncestralDiscreteScheduler(SchedulerMixin, ConfigMixin):
timesteps
=
timesteps
.
to
(
original_samples
.
device
)
schedule_timesteps
=
self
.
timesteps
if
isinstance
(
timesteps
,
torch
.
IntTensor
)
or
isinstance
(
timesteps
,
torch
.
LongTensor
):
deprecate
(
"timesteps as indices"
,
"0.8.0"
,
"Passing integer indices (e.g. from `enumerate(timesteps)`) as timesteps to"
" `EulerAncestralDiscreteScheduler.add_noise()` will not be supported in future versions. Make sure to"
" pass values from `scheduler.timesteps` as timesteps."
,
standard_warn
=
False
,
)
step_indices
=
timesteps
else
:
step_indices
=
[(
schedule_timesteps
==
t
).
nonzero
().
item
()
for
t
in
timesteps
]
step_indices
=
[(
schedule_timesteps
==
t
).
nonzero
().
item
()
for
t
in
timesteps
]
sigma
=
self
.
sigmas
[
step_indices
].
flatten
()
while
len
(
sigma
.
shape
)
<
len
(
original_samples
.
shape
):
...
...
src/diffusers/schedulers/scheduling_euler_discrete.py
View file @
2fcae69f
...
...
@@ -19,7 +19,7 @@ import numpy as np
import
torch
from
..configuration_utils
import
ConfigMixin
,
register_to_config
from
..utils
import
BaseOutput
,
deprecate
,
logging
from
..utils
import
BaseOutput
,
logging
from
.scheduling_utils
import
SchedulerMixin
...
...
@@ -262,19 +262,7 @@ class EulerDiscreteScheduler(SchedulerMixin, ConfigMixin):
timesteps
=
timesteps
.
to
(
original_samples
.
device
)
schedule_timesteps
=
self
.
timesteps
if
isinstance
(
timesteps
,
torch
.
IntTensor
)
or
isinstance
(
timesteps
,
torch
.
LongTensor
):
deprecate
(
"timesteps as indices"
,
"0.8.0"
,
"Passing integer indices (e.g. from `enumerate(timesteps)`) as timesteps to"
" `EulerDiscreteScheduler.add_noise()` will not be supported in future versions. Make sure to"
" pass values from `scheduler.timesteps` as timesteps."
,
standard_warn
=
False
,
)
step_indices
=
timesteps
else
:
step_indices
=
[(
schedule_timesteps
==
t
).
nonzero
().
item
()
for
t
in
timesteps
]
step_indices
=
[(
schedule_timesteps
==
t
).
nonzero
().
item
()
for
t
in
timesteps
]
sigma
=
self
.
sigmas
[
step_indices
].
flatten
()
while
len
(
sigma
.
shape
)
<
len
(
original_samples
.
shape
):
...
...
src/diffusers/schedulers/scheduling_lms_discrete.py
View file @
2fcae69f
...
...
@@ -21,7 +21,7 @@ import torch
from
scipy
import
integrate
from
..configuration_utils
import
ConfigMixin
,
register_to_config
from
..utils
import
BaseOutput
,
deprecate
from
..utils
import
BaseOutput
from
.scheduling_utils
import
SchedulerMixin
...
...
@@ -211,22 +211,7 @@ class LMSDiscreteScheduler(SchedulerMixin, ConfigMixin):
if
isinstance
(
timestep
,
torch
.
Tensor
):
timestep
=
timestep
.
to
(
self
.
timesteps
.
device
)
if
(
isinstance
(
timestep
,
int
)
or
isinstance
(
timestep
,
torch
.
IntTensor
)
or
isinstance
(
timestep
,
torch
.
LongTensor
)
):
deprecate
(
"timestep as an index"
,
"0.8.0"
,
"Passing integer indices (e.g. from `enumerate(timesteps)`) as timesteps to"
" `LMSDiscreteScheduler.step()` will not be supported in future versions. Make sure to pass"
" one of the `scheduler.timesteps` as a timestep."
,
standard_warn
=
False
,
)
step_index
=
timestep
else
:
step_index
=
(
self
.
timesteps
==
timestep
).
nonzero
().
item
()
step_index
=
(
self
.
timesteps
==
timestep
).
nonzero
().
item
()
sigma
=
self
.
sigmas
[
step_index
]
# 1. compute predicted original sample (x_0) from sigma-scaled predicted noise
...
...
@@ -269,19 +254,7 @@ class LMSDiscreteScheduler(SchedulerMixin, ConfigMixin):
timesteps
=
timesteps
.
to
(
original_samples
.
device
)
schedule_timesteps
=
self
.
timesteps
if
isinstance
(
timesteps
,
torch
.
IntTensor
)
or
isinstance
(
timesteps
,
torch
.
LongTensor
):
deprecate
(
"timesteps as indices"
,
"0.8.0"
,
"Passing integer indices (e.g. from `enumerate(timesteps)`) as timesteps to"
" `LMSDiscreteScheduler.add_noise()` will not be supported in future versions. Make sure to"
" pass values from `scheduler.timesteps` as timesteps."
,
standard_warn
=
False
,
)
step_indices
=
timesteps
else
:
step_indices
=
[(
schedule_timesteps
==
t
).
nonzero
().
item
()
for
t
in
timesteps
]
step_indices
=
[(
schedule_timesteps
==
t
).
nonzero
().
item
()
for
t
in
timesteps
]
sigma
=
self
.
sigmas
[
step_indices
].
flatten
()
while
len
(
sigma
.
shape
)
<
len
(
original_samples
.
shape
):
...
...
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