Download comfy_extras/nodes_mochi.py from fotographerai/Zen-Style-Shape: direct link, hf CLI and curl.
- Browser
- Download file 990 Bytes
-
https://huggingface.co/spaces/fotographerai/Zen-Style-Shape/resolve/a8e42f9c629cb3adc0232d23fc09d1e375af4f5b/comfy_extras/nodes_mochi.py
- Command line
-
hf download hf://spaces/fotographerai/Zen-Style-Shape@a8e42f9c629cb3adc0232d23fc09d1e375af4f5b/comfy_extras/nodes_mochi.py
-
curl -L -o nodes_mochi.py https://huggingface.co/spaces/fotographerai/Zen-Style-Shape/resolve/a8e42f9c629cb3adc0232d23fc09d1e375af4f5b/comfy_extras/nodes_mochi.py
990 Bytes
| import nodes | |
| import torch | |
| import comfy.model_management | |
| class EmptyMochiLatentVideo: | |
| def INPUT_TYPES(s): | |
| return {"required": { "width": ("INT", {"default": 848, "min": 16, "max": nodes.MAX_RESOLUTION, "step": 16}), | |
| "height": ("INT", {"default": 480, "min": 16, "max": nodes.MAX_RESOLUTION, "step": 16}), | |
| "length": ("INT", {"default": 25, "min": 7, "max": nodes.MAX_RESOLUTION, "step": 6}), | |
| "batch_size": ("INT", {"default": 1, "min": 1, "max": 4096})}} | |
| RETURN_TYPES = ("LATENT",) | |
| FUNCTION = "generate" | |
| CATEGORY = "latent/video" | |
| def generate(self, width, height, length, batch_size=1): | |
| latent = torch.zeros([batch_size, 12, ((length - 1) // 6) + 1, height // 8, width // 8], device=comfy.model_management.intermediate_device()) | |
| return ({"samples":latent}, ) | |
| NODE_CLASS_MAPPINGS = { | |
| "EmptyMochiLatentVideo": EmptyMochiLatentVideo, | |
| } | |