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
chenpangpang
ComfyUI
Commits
fe4c0740
"ppocr/git@developer.sourcefind.cn:wangsen/paddle_dbnet.git" did not exist on "b77f9ec0bbebaface15346f088aac1e95d907543"
Commit
fe4c0740
authored
Aug 29, 2023
by
comfyanonymous
Browse files
Fix "Load Checkpoint with config" node.
parent
d70b0bc4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
comfy/sd.py
comfy/sd.py
+4
-2
comfy/supported_models_base.py
comfy/supported_models_base.py
+2
-0
No files found.
comfy/sd.py
View file @
fe4c0740
...
@@ -22,6 +22,7 @@ from . import sdxl_clip
...
@@ -22,6 +22,7 @@ from . import sdxl_clip
import
comfy.model_patcher
import
comfy.model_patcher
import
comfy.lora
import
comfy.lora
import
comfy.t2i_adapter.adapter
import
comfy.t2i_adapter.adapter
import
comfy.supported_models_base
def
load_model_weights
(
model
,
sd
):
def
load_model_weights
(
model
,
sd
):
m
,
u
=
model
.
load_state_dict
(
sd
,
strict
=
False
)
m
,
u
=
model
.
load_state_dict
(
sd
,
strict
=
False
)
...
@@ -348,10 +349,11 @@ def load_checkpoint(config_path=None, ckpt_path=None, output_vae=True, output_cl
...
@@ -348,10 +349,11 @@ def load_checkpoint(config_path=None, ckpt_path=None, output_vae=True, output_cl
class
EmptyClass
:
class
EmptyClass
:
pass
pass
model_config
=
EmptyClass
(
)
model_config
=
comfy
.
supported_models_base
.
BASE
({}
)
model_config
.
unet_config
=
unet_config
from
.
import
latent_formats
from
.
import
latent_formats
model_config
.
latent_format
=
latent_formats
.
SD15
(
scale_factor
=
scale_factor
)
model_config
.
latent_format
=
latent_formats
.
SD15
(
scale_factor
=
scale_factor
)
model_config
.
unet_config
=
unet_config
if
config
[
'model'
][
"target"
].
endswith
(
"LatentInpaintDiffusion"
):
if
config
[
'model'
][
"target"
].
endswith
(
"LatentInpaintDiffusion"
):
model
=
model_base
.
SDInpaint
(
model_config
,
model_type
=
model_type
)
model
=
model_base
.
SDInpaint
(
model_config
,
model_type
=
model_type
)
...
...
comfy/supported_models_base.py
View file @
fe4c0740
import
torch
import
torch
from
.
import
model_base
from
.
import
model_base
from
.
import
utils
from
.
import
utils
from
.
import
latent_formats
def
state_dict_key_replace
(
state_dict
,
keys_to_replace
):
def
state_dict_key_replace
(
state_dict
,
keys_to_replace
):
...
@@ -34,6 +35,7 @@ class BASE:
...
@@ -34,6 +35,7 @@ class BASE:
clip_vision_prefix
=
None
clip_vision_prefix
=
None
noise_aug_config
=
None
noise_aug_config
=
None
beta_schedule
=
"linear"
beta_schedule
=
"linear"
latent_format
=
latent_formats
.
LatentFormat
@
classmethod
@
classmethod
def
matches
(
s
,
unet_config
):
def
matches
(
s
,
unet_config
):
...
...
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