Created
September 23, 2025 05:07
-
-
Save hathibelagal-dev/bcc2d29fc8edab676d0f593eca069318 to your computer and use it in GitHub Desktop.
A minimal script to get started with using ComfyUI as a library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys, os | |
| comfy_path = "/content/ComfyUI" | |
| sys.path.insert(0, comfy_path) | |
| import importlib.util | |
| utils_path = os.path.join(comfy_path, "utils") | |
| spec = importlib.util.spec_from_file_location("utils", os.path.join(utils_path, "__init__.py") if os.path.exists(os.path.join(utils_path, "__init__.py")) else os.devnull) | |
| utils = importlib.util.module_from_spec(spec) | |
| sys.modules["utils"] = utils | |
| import nodes | |
| import asyncio | |
| from server import PromptServer | |
| loop = asyncio.new_event_loop() | |
| PromptServer.instance = PromptServer(loop) | |
| async def t(): | |
| await nodes.init_external_custom_nodes() | |
| n = nodes.NODE_CLASS_MAPPINGS | |
| for item in n: | |
| if item.find("VHS_") != -1: | |
| print(item) | |
| asyncio.run(t()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For example, for Wan 2.1 T2V with lightx2v LoRA: