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
f6f1ec3a
Unverified
Commit
f6f1ec3a
authored
Jan 10, 2023
by
Patrick von Platen
Committed by
GitHub
Jan 10, 2023
Browse files
allow loading ddpm models into ddim (#1932)
parent
beb932c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
src/diffusers/pipelines/ddim/pipeline_ddim.py
src/diffusers/pipelines/ddim/pipeline_ddim.py
+5
-0
No files found.
src/diffusers/pipelines/ddim/pipeline_ddim.py
View file @
f6f1ec3a
...
@@ -16,6 +16,7 @@ from typing import List, Optional, Tuple, Union
...
@@ -16,6 +16,7 @@ from typing import List, Optional, Tuple, Union
import
torch
import
torch
from
...schedulers
import
DDIMScheduler
from
...utils
import
deprecate
,
randn_tensor
from
...utils
import
deprecate
,
randn_tensor
from
..pipeline_utils
import
DiffusionPipeline
,
ImagePipelineOutput
from
..pipeline_utils
import
DiffusionPipeline
,
ImagePipelineOutput
...
@@ -34,6 +35,10 @@ class DDIMPipeline(DiffusionPipeline):
...
@@ -34,6 +35,10 @@ class DDIMPipeline(DiffusionPipeline):
def
__init__
(
self
,
unet
,
scheduler
):
def
__init__
(
self
,
unet
,
scheduler
):
super
().
__init__
()
super
().
__init__
()
# make sure scheduler can always be converted to DDIM
scheduler
=
DDIMScheduler
.
from_config
(
scheduler
.
config
)
self
.
register_modules
(
unet
=
unet
,
scheduler
=
scheduler
)
self
.
register_modules
(
unet
=
unet
,
scheduler
=
scheduler
)
@
torch
.
no_grad
()
@
torch
.
no_grad
()
...
...
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