Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions comfy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1135,8 +1135,8 @@ def mult_list_upscale(a):
pbar.update(1)
continue

out = torch.zeros([s.shape[0], out_channels] + mult_list_upscale(s.shape[2:]), device=output_device)
out_div = torch.zeros([s.shape[0], out_channels] + mult_list_upscale(s.shape[2:]), device=output_device)
out = output[b:b+1].zero_()
out_div = torch.zeros([s.shape[0], 1] + mult_list_upscale(s.shape[2:]), device=output_device)

positions = [range(0, s.shape[d+2] - overlap[d], tile[d] - overlap[d]) if s.shape[d+2] > tile[d] else [0] for d in range(dims)]

Expand All @@ -1151,7 +1151,7 @@ def mult_list_upscale(a):
upscaled.append(round(get_pos(d, pos)))

ps = function(s_in).to(output_device)
mask = torch.ones_like(ps)
mask = torch.ones([1, 1] + list(ps.shape[2:]), device=output_device)

for d in range(2, dims + 2):
feather = round(get_scale(d - 2, overlap[d - 2]))
Expand All @@ -1174,7 +1174,7 @@ def mult_list_upscale(a):
if pbar is not None:
pbar.update(1)

output[b:b+1] = out/out_div
out.div_(out_div)
return output

def tiled_scale(samples, function, tile_x=64, tile_y=64, overlap = 8, upscale_amount = 4, out_channels = 3, output_device="cpu", pbar = None):
Expand Down
Loading