Skip to content

Commit 1883e70

Browse files
Fix exception when using a noise mask with cosmos predict2. (Comfy-Org#8621)
* Fix exception when using a noise mask with cosmos predict2. * Fix ruff.
1 parent 31ca603 commit 1883e70

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

comfy/model_base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,8 @@ def extra_conds(self, **kwargs):
10241024
def process_timestep(self, timestep, x, denoise_mask=None, **kwargs):
10251025
if denoise_mask is None:
10261026
return timestep
1027+
if denoise_mask.ndim <= 4:
1028+
return timestep
10271029
condition_video_mask_B_1_T_1_1 = denoise_mask.mean(dim=[1, 3, 4], keepdim=True)
10281030
c_noise_B_1_T_1_1 = 0.0 * (1.0 - condition_video_mask_B_1_T_1_1) + timestep.reshape(timestep.shape[0], 1, 1, 1, 1) * condition_video_mask_B_1_T_1_1
10291031
out = c_noise_B_1_T_1_1.squeeze(dim=[1, 3, 4])

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def prompt_worker(q, server_instance):
185185

186186
current_time = time.perf_counter()
187187
execution_time = current_time - execution_start_time
188-
188+
189189
# Log Time in a more readable way after 10 minutes
190190
if execution_time > 600:
191191
execution_time = time.strftime("%H:%M:%S", time.gmtime(execution_time))

0 commit comments

Comments
 (0)