Team Ai
Datasetpublic

Mightys/Notebook_Scripts

sourceHugging Faceupdated 20h agoView on Hugging Face
0likes2.6kdownloads
temp_dir.py40 linesDownload Raw Back to Comfyui-Lightning
1#!/usr/bin/env python32# temp_dir.py  –  enlaza carpetas temporales de ComfyUI a /tmp3import subprocess4from pathlib import Path5 6def _run(cmd: str) -> None:7    print(f"+ {cmd}")8    subprocess.run(cmd, shell=True, check=False)9 10def enlaces_tmp_comfy() -> None:11    """Crea enlaces simbólicos para que ComfyUI use /tmp y libere espacio en disco."""12    base = Path("/teamspace/studios/this_studio")13    cmds = [14        "rm -rf /teamspace/studios/this_studio/tmp ~/tmp",15        "ln -vs /tmp ~/tmp",16        "rm -rf /teamspace/studios/this_studio/ComfyUI/models/checkpoints/tmp_models",17        "mkdir -p /tmp/models",18        "ln -vs /tmp/models /teamspace/studios/this_studio/ComfyUI/models/checkpoints/tmp_models",19        "rm -rf /teamspace/studios/this_studio/ComfyUI/models/loras/tmp_lora",20        "mkdir -p /tmp/lora",21        "ln -vs /tmp/lora /teamspace/studios/this_studio/ComfyUI/models/loras/tmp_lora",22        "rm -rf /teamspace/studios/this_studio/ComfyUI/models/diffusion_models",23        "mkdir -p /tmp/diffusion_models",24        "ln -vs /tmp/diffusion_models /teamspace/studios/this_studio/ComfyUI/models/diffusion_models",25        "rm -rf /teamspace/studios/this_studio/ComfyUI/models/text_encoders",26        "mkdir -p /tmp/text_encoders",27        "ln -vs /tmp/text_encoders /teamspace/studios/this_studio/ComfyUI/models/text_encoders",28        "rm -rf /teamspace/studios/this_studio/ComfyUI/models/unet",29        "mkdir -p /tmp/unet",30        "ln -vs /tmp/unet /teamspace/studios/this_studio/ComfyUI/models/unet",31        "rm -rf /teamspace/studios/this_studio/ComfyUI/models/controlnet",32        "mkdir -p /tmp/controlnet",33        "ln -vs /tmp/controlnet /teamspace/studios/this_studio/ComfyUI/models/controlnet",34    ]35    for c in cmds:36        _run(c)37    print("✅ Carpetas temporales de ComfyUI enlazadas.")38 39if __name__ == "__main__":40    enlaces_tmp_comfy()