melMass / comfy_mtb

Animation oriented nodes pack for ComfyUI
MIT License
431 stars 49 forks source link

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

Open Hsad opened 1 year ago

Hsad commented 1 year ago

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))},)
Davikar commented 4 months ago

This is still an issue with this node.