Download Comfyui-Lightning/temp_dir.py from Mightys/Notebook_Scripts: direct link, hf CLI and curl.
- Browser
- Download file 1.89 kB
-
https://huggingface.co/datasets/Mightys/Notebook_Scripts/resolve/main/Comfyui-Lightning/temp_dir.py
- Command line
-
hf download hf://datasets/Mightys/Notebook_Scripts/Comfyui-Lightning/temp_dir.py
-
curl -L -o temp_dir.py https://huggingface.co/datasets/Mightys/Notebook_Scripts/resolve/main/Comfyui-Lightning/temp_dir.py
1.89 kB
| #!/usr/bin/env python3 | |
| # temp_dir.py – enlaza carpetas temporales de ComfyUI a /tmp | |
| import subprocess | |
| from pathlib import Path | |
| def _run(cmd: str) -> None: | |
| print(f"+ {cmd}") | |
| subprocess.run(cmd, shell=True, check=False) | |
| def enlaces_tmp_comfy() -> None: | |
| """Crea enlaces simbólicos para que ComfyUI use /tmp y libere espacio en disco.""" | |
| base = Path("/teamspace/studios/this_studio") | |
| cmds = [ | |
| "rm -rf /teamspace/studios/this_studio/tmp ~/tmp", | |
| "ln -vs /tmp ~/tmp", | |
| "rm -rf /teamspace/studios/this_studio/ComfyUI/models/checkpoints/tmp_models", | |
| "mkdir -p /tmp/models", | |
| "ln -vs /tmp/models /teamspace/studios/this_studio/ComfyUI/models/checkpoints/tmp_models", | |
| "rm -rf /teamspace/studios/this_studio/ComfyUI/models/loras/tmp_lora", | |
| "mkdir -p /tmp/lora", | |
| "ln -vs /tmp/lora /teamspace/studios/this_studio/ComfyUI/models/loras/tmp_lora", | |
| "rm -rf /teamspace/studios/this_studio/ComfyUI/models/diffusion_models", | |
| "mkdir -p /tmp/diffusion_models", | |
| "ln -vs /tmp/diffusion_models /teamspace/studios/this_studio/ComfyUI/models/diffusion_models", | |
| "rm -rf /teamspace/studios/this_studio/ComfyUI/models/text_encoders", | |
| "mkdir -p /tmp/text_encoders", | |
| "ln -vs /tmp/text_encoders /teamspace/studios/this_studio/ComfyUI/models/text_encoders", | |
| "rm -rf /teamspace/studios/this_studio/ComfyUI/models/unet", | |
| "mkdir -p /tmp/unet", | |
| "ln -vs /tmp/unet /teamspace/studios/this_studio/ComfyUI/models/unet", | |
| "rm -rf /teamspace/studios/this_studio/ComfyUI/models/controlnet", | |
| "mkdir -p /tmp/controlnet", | |
| "ln -vs /tmp/controlnet /teamspace/studios/this_studio/ComfyUI/models/controlnet", | |
| ] | |
| for c in cmds: | |
| _run(c) | |
| print("✅ Carpetas temporales de ComfyUI enlazadas.") | |
| if __name__ == "__main__": | |
| enlaces_tmp_comfy() |