Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
s9roll7 committed Dec 9, 2023
1 parent 33cb8c1 commit bed619e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/animatediff/pipelines/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2778,6 +2778,9 @@ def resize_tensor(ten, size, do_unsharp_mask=False):
shrink_controlnet = True
no_shrink_type = ["controlnet_tile"]

for nt in no_shrink_type:
controlnet_type_map[nt] = controlnet_type_map.pop(nt)

def need_region_blend(cur_step, total_steps):
if cur_step + 1 == total_steps:
return True
Expand Down Expand Up @@ -2910,6 +2913,14 @@ def merge_result(fr, type_str):

mod = torch.tensor(scales).to(device, dtype=cur_mid.dtype)

'''
for ii in range(len(_down_block_res_samples)):
logger.info(f"{type_str=} / {cur_down[ii].shape=}")
logger.info(f"{type_str=} / {_down_block_res_samples[ii].shape=}")
logger.info(f"{type_str=} / {cur_mid.shape=}")
logger.info(f"{type_str=} / {_mid_block_res_samples.shape=}")
'''

add = cur_mid * mod[None,None,:,None,None]
_mid_block_res_samples[:, :, loc_index, :, :] = _mid_block_res_samples[:, :, loc_index, :, :] + add

Expand Down Expand Up @@ -3109,6 +3120,12 @@ def sample_to_device( sample ):
if frame_no not in controlnet_result:
controlnet_result[frame_no] = {}

'''
for ii in range(len(down_samples)):
logger.info(f"{type_str=} / {down_samples[ii].shape=}")
logger.info(f"{type_str=} / {mid_sample.shape=}")
'''

controlnet_result[frame_no][type_str] = sample_to_device((down_samples, mid_sample))

if org_device != device:
Expand Down

0 comments on commit bed619e

Please sign in to comment.