willybonso
v1.4.2 - Paquete completo: BonsoNet, Bonso Pose, Mask Crop Bonso, Easy Model Bonso
6efa2d8 Download nodes/bonso_branding.py from OSOBONSO/comfyui_Bonso_Tools: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/OSOBONSO/comfyui_Bonso_Tools/resolve/main/nodes/bonso_branding.py
- Command line
-
hf download hf://OSOBONSO/comfyui_Bonso_Tools/nodes/bonso_branding.py
-
curl -L -o bonso_branding.py https://huggingface.co/OSOBONSO/comfyui_Bonso_Tools/resolve/main/nodes/bonso_branding.py
1.04 kB
| import os | |
| from aiohttp import web | |
| from server import PromptServer | |
| _PKG_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
| _ASSETS = os.path.join(_PKG_ROOT, "assets") | |
| _PREFERRED = ("BONSO_TOOLS.png", "bonso_tools.png", "icon.png") | |
| def find_icon(): | |
| for name in _PREFERRED: | |
| path = os.path.join(_ASSETS, name) | |
| if os.path.isfile(path): | |
| return path | |
| try: | |
| for name in sorted(os.listdir(_ASSETS)): | |
| low = name.lower() | |
| if low.endswith(".png") and ("bonso" in low or "icon" in low): | |
| return os.path.join(_ASSETS, name) | |
| except OSError: | |
| pass | |
| return None | |
| async def brand_icon(request): | |
| path = find_icon() | |
| if not path: | |
| return web.json_response( | |
| {"error": "No Bonso Tools icon found in assets/."}, status=404) | |
| return web.FileResponse(path, headers={"Cache-Control": "max-age=86400"}) | |
| NODE_CLASS_MAPPINGS = {} | |
| NODE_DISPLAY_NAME_MAPPINGS = {} | |