Spaces:
Runtime error
Runtime error
Tony Lian commited on
Commit ·
b1ea54b
1
Parent(s): 363907c
Use fast_after_steps only with use_fast_schedule
Browse files73 unmodified lines7475767778798073 unmodified lineslatents_all, mask_tensor = latents_all_list[mask_idx], mask_tensor_list[mask_idx]foreground_indices = foreground_indices * (~mask_tensor) + (mask_idx + 1) * mask_tensormask_tensor_expanded = mask_tensor[None, None, None, ...].to(dtype)composed_latents = composed_latents * (1. - mask_tensor_expanded) + latents_all[:fast_after_steps + 1] * mask_tensor_expandedcomposed_latents, foreground_indices = composed_latents.to(torch_device), foreground_indices.to(torch_device)return composed_latents, foreground_indices73 unmodified lines7475767778798081828373 unmodified lineslatents_all, mask_tensor = latents_all_list[mask_idx], mask_tensor_list[mask_idx]foreground_indices = foreground_indices * (~mask_tensor) + (mask_idx + 1) * mask_tensormask_tensor_expanded = mask_tensor[None, None, None, ...].to(dtype)if use_fast_schedule:composed_latents = composed_latents * (1. - mask_tensor_expanded) + latents_all[:fast_after_steps + 1] * mask_tensor_expandedelse:composed_latents = composed_latents * (1. - mask_tensor_expanded) + latents_all * mask_tensor_expandedcomposed_latents, foreground_indices = composed_latents.to(torch_device), foreground_indices.to(torch_device)return composed_latents, foreground_indices
utils/latents.py+4-1