comfy_mtb icon indicating copy to clipboard operation
comfy_mtb copied to clipboard

[bug] Lerp_Latent is a shallow copy and overwrites latent A

Open Hsad opened this issue 1 year ago • 1 comments

Describe the bug

The latents passed to lerp_latent are overwritten by the function

Reproduction

use multiple lerp_latent nodes, the result will drift from the expected mixture.

Expected behavior

The input latents should remain uneffected by the node

Operating System

Linux

Comfy Mode

In a custom virtual env (venv, virtualenv, conda...)

Console output

No response

Additional context

The solution appears to be replacing the lerp_latent function body with this line

def lerp_latent(self, A, B, t):  
    return ({"samples":(torch.lerp(A["samples"], B["samples"], t))},)

Hsad avatar Sep 21 '23 18:09 Hsad

This is still an issue with this node.

Davikar avatar Jun 16 '24 23:06 Davikar