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
494cfe54
"git@developer.sourcefind.cn:wangsen/paddle_dbnet.git" did not exist on "68380ab8cd5a40a2b4e812cd9a649fe3838b682f"
Commit
494cfe54
authored
Mar 15, 2023
by
comfyanonymous
Browse files
Prevent model_management from being loaded twice.
parent
07598e27
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
comfy_extras/nodes_upscale_model.py
comfy_extras/nodes_upscale_model.py
+2
-2
No files found.
comfy_extras/nodes_upscale_model.py
View file @
494cfe54
import
os
import
os
from
comfy_extras.chainner_models
import
model_loading
from
comfy_extras.chainner_models
import
model_loading
from
comfy.sd
import
load_torch_file
from
comfy.sd
import
load_torch_file
import
comfy.
model_management
import
model_management
from
nodes
import
filter_files_extensions
,
recursive_search
,
supported_ckpt_extensions
from
nodes
import
filter_files_extensions
,
recursive_search
,
supported_ckpt_extensions
import
torch
import
torch
import
comfy.utils
import
comfy.utils
...
@@ -38,7 +38,7 @@ class ImageUpscaleWithModel:
...
@@ -38,7 +38,7 @@ class ImageUpscaleWithModel:
CATEGORY
=
"image/upscaling"
CATEGORY
=
"image/upscaling"
def
upscale
(
self
,
upscale_model
,
image
):
def
upscale
(
self
,
upscale_model
,
image
):
device
=
comfy
.
model_management
.
get_torch_device
()
device
=
model_management
.
get_torch_device
()
upscale_model
.
to
(
device
)
upscale_model
.
to
(
device
)
in_img
=
image
.
movedim
(
-
1
,
-
3
).
to
(
device
)
in_img
=
image
.
movedim
(
-
1
,
-
3
).
to
(
device
)
s
=
comfy
.
utils
.
tiled_scale
(
in_img
,
lambda
a
:
upscale_model
(
a
),
tile_x
=
128
+
64
,
tile_y
=
128
+
64
,
overlap
=
8
,
upscale_amount
=
upscale_model
.
scale
)
s
=
comfy
.
utils
.
tiled_scale
(
in_img
,
lambda
a
:
upscale_model
(
a
),
tile_x
=
128
+
64
,
tile_y
=
128
+
64
,
overlap
=
8
,
upscale_amount
=
upscale_model
.
scale
)
...
...
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