Download nodes/bonso_filename.py from OSOBONSO/comfyui_Bonso_Tools: direct link, hf CLI and curl.
- Browser
- Download file 1.6 kB
-
https://huggingface.co/OSOBONSO/comfyui_Bonso_Tools/resolve/main/nodes/bonso_filename.py
- Command line
-
hf download hf://OSOBONSO/comfyui_Bonso_Tools/nodes/bonso_filename.py
-
curl -L -o bonso_filename.py https://huggingface.co/OSOBONSO/comfyui_Bonso_Tools/resolve/main/nodes/bonso_filename.py
1.6 kB
| class Bonso_FileName: | |
| """Une las lineas Linea_1..Linea_6 en una ruta "carpeta/subcarpeta". | |
| Cero entradas, una salida de texto. Las lineas vacias se ignoran y, | |
| si no queda ninguna, devuelve "Bonso". | |
| Linea_1..Linea_6 son las casillas del lienzo; el JS decide cuales se | |
| ven con `widget.hidden`. `_boxes` guarda cuantas casillas hay visibles | |
| para recuperar el diseno al cargar el workflow y siempre esta oculto. | |
| """ | |
| SLOTS = 6 | |
| def INPUT_TYPES(cls): | |
| lineas = { | |
| f"Linea_{i}": ("STRING", {"default": "", "multiline": False}) | |
| for i in range(1, cls.SLOTS + 1) | |
| } | |
| lineas["_boxes"] = ( | |
| "INT", | |
| {"default": 1, "min": 1, "max": cls.SLOTS, "step": 1}, | |
| ) | |
| return {"required": lineas} | |
| RETURN_TYPES = ("STRING",) | |
| RETURN_NAMES = ("texto",) | |
| FUNCTION = "build_path" | |
| CATEGORY = "Bonso Tools" | |
| DESCRIPTION = ( | |
| "Une las lineas rellenas con '/' y devuelve la ruta. " | |
| "Las lineas vacias se ignoran; si no queda ninguna, devuelve 'Bonso'." | |
| ) | |
| def build_path( | |
| self, | |
| Linea_1="", | |
| Linea_2="", | |
| Linea_3="", | |
| Linea_4="", | |
| Linea_5="", | |
| Linea_6="", | |
| _boxes=1, | |
| ): | |
| partes = [str(s).strip() for s in (Linea_1, Linea_2, Linea_3, Linea_4, Linea_5, Linea_6)] | |
| partes = [p for p in partes if p] | |
| return ("/".join(partes) or "Bonso",) | |
| NODE_CLASS_MAPPINGS = { | |
| "Bonso_FileName": Bonso_FileName, | |
| } | |
| NODE_DISPLAY_NAME_MAPPINGS = { | |
| "Bonso_FileName": "Bonso_FileName", | |
| } | |