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
f6f1ec3a
"git@developer.sourcefind.cn:OpenDAS/torch-harmonics.git" did not exist on "be8c67193d5f9b63e5d6bd4eca55d57278f76d2b"
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