mirror of
https://github.com/facefusion/facefusion-labs.git
synced 2026-05-22 23:59:40 +02:00
Name color tensor -> overlay tensor
This commit is contained in:
@@ -39,8 +39,8 @@ def calc_embedding(embedder : EmbedderModule, input_tensor : Tensor, padding : P
|
||||
|
||||
|
||||
def overlay_mask(target_tensor : Tensor, mask_tensor : Tensor) -> Tensor:
|
||||
temp_tensor = torch.zeros(*target_tensor.shape, dtype = target_tensor.dtype, device = target_tensor.device)
|
||||
temp_tensor[:, 2, :, :] = 1
|
||||
overlay_tensor = torch.zeros(*target_tensor.shape, dtype = target_tensor.dtype, device = target_tensor.device)
|
||||
overlay_tensor[:, 2, :, :] = 1
|
||||
mask_tensor = mask_tensor.repeat(1, 3, 1, 1).clamp(0, 0.8)
|
||||
output_tensor = target_tensor * (1 - mask_tensor) + temp_tensor * mask_tensor
|
||||
output_tensor = target_tensor * (1 - mask_tensor) + overlay_tensor * mask_tensor
|
||||
return output_tensor
|
||||
|
||||
Reference in New Issue
Block a user