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
8912623e
"git@developer.sourcefind.cn:wangsen/paddle_dbnet.git" did not exist on "a0c8968c96b11982f8806bd05c6cb4ece5f6b068"
Commit
8912623e
authored
May 03, 2023
by
pythongosssss
Browse files
use comfy progress bar
parent
fdf57325
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
comfy/sd.py
comfy/sd.py
+3
-3
comfy_extras/nodes_upscale_model.py
comfy_extras/nodes_upscale_model.py
+2
-2
No files found.
comfy/sd.py
View file @
8912623e
...
...
@@ -516,7 +516,7 @@ class VAE:
def
decode_tiled_
(
self
,
samples
,
tile_x
=
64
,
tile_y
=
64
,
overlap
=
16
):
steps
=
samples
.
shape
[
0
]
*
utils
.
get_tiled_scale_steps
(
samples
.
shape
[
3
],
samples
.
shape
[
2
],
tile_x
,
tile_y
,
overlap
)
pbar
=
tqdm
(
total
=
steps
)
pbar
=
utils
.
ProgressBar
(
steps
)
decode_fn
=
lambda
a
:
(
self
.
first_stage_model
.
decode
(
1.
/
self
.
scale_factor
*
a
.
to
(
self
.
device
))
+
1.0
)
output
=
torch
.
clamp
((
...
...
@@ -568,8 +568,8 @@ class VAE:
pixel_samples
=
pixel_samples
.
movedim
(
-
1
,
1
).
to
(
self
.
device
)
steps
=
utils
.
get_tiled_scale_steps
(
pixel_samples
.
shape
[
3
],
pixel_samples
.
shape
[
2
],
tile_x
,
tile_y
,
overlap
)
pbar
=
tqdm
(
total
=
steps
)
pbar
=
utils
.
ProgressBar
(
steps
)
samples
=
utils
.
tiled_scale
(
pixel_samples
,
lambda
a
:
self
.
first_stage_model
.
encode
(
2.
*
a
-
1.
).
sample
()
*
self
.
scale_factor
,
tile_x
,
tile_y
,
overlap
,
upscale_amount
=
(
1
/
8
),
out_channels
=
4
,
pbar
=
pbar
)
samples
+=
utils
.
tiled_scale
(
pixel_samples
,
lambda
a
:
self
.
first_stage_model
.
encode
(
2.
*
a
-
1.
).
sample
()
*
self
.
scale_factor
,
tile_x
*
2
,
tile_y
//
2
,
overlap
,
upscale_amount
=
(
1
/
8
),
out_channels
=
4
,
pbar
=
pbar
)
samples
+=
utils
.
tiled_scale
(
pixel_samples
,
lambda
a
:
self
.
first_stage_model
.
encode
(
2.
*
a
-
1.
).
sample
()
*
self
.
scale_factor
,
tile_x
//
2
,
tile_y
*
2
,
overlap
,
upscale_amount
=
(
1
/
8
),
out_channels
=
4
,
pbar
=
pbar
)
...
...
comfy_extras/nodes_upscale_model.py
View file @
8912623e
...
...
@@ -41,8 +41,8 @@ class ImageUpscaleWithModel:
tile
=
128
+
64
overlap
=
8
it
s
=
-
(
in_img
.
shape
[
2
]
//
-
(
tile
-
overlap
))
*
-
(
in_img
.
shape
[
3
]
//
-
(
tile
-
overlap
))
pbar
=
tqdm
(
total
=
it
s
)
step
s
=
-
(
in_img
.
shape
[
2
]
//
-
(
tile
-
overlap
))
*
-
(
in_img
.
shape
[
3
]
//
-
(
tile
-
overlap
))
pbar
=
comfy
.
utils
.
ProgressBar
(
step
s
)
s
=
comfy
.
utils
.
tiled_scale
(
in_img
,
lambda
a
:
upscale_model
(
a
),
tile_x
=
tile
,
tile_y
=
tile
,
overlap
=
overlap
,
upscale_amount
=
upscale_model
.
scale
,
pbar
=
pbar
)
upscale_model
.
cpu
()
s
=
torch
.
clamp
(
s
.
movedim
(
-
3
,
-
1
),
min
=
0
,
max
=
1.0
)
...
...
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