| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| import os as _os |
| import sys as _sys |
|
|
|
|
| def _ensure_stanno_importable() -> None: |
| """ |
| Make the `stanno` Python package importable. |
| |
| Resolution order: |
| 1. Already pip-installed (pip install stanno or pip install -e .) → done. |
| 2. Monorepo layout: this __init__.py is at <repo>/comfyui-stanno/__init__.py |
| and the stanno Python package lives at <repo>/stanno/. |
| → add <repo> to sys.path. |
| 3. Neither works → raise ImportError with install instructions. |
| """ |
| try: |
| import stanno |
| return |
| except ImportError: |
| pass |
|
|
| |
| _here = _os.path.dirname(_os.path.abspath(__file__)) |
| _parent = _os.path.dirname(_here) |
| if _os.path.isdir(_os.path.join(_parent, "stanno")): |
| if _parent not in _sys.path: |
| _sys.path.insert(0, _parent) |
| try: |
| import stanno |
| return |
| except ImportError: |
| pass |
|
|
| raise ImportError( |
| "The `stanno` package is not installed and could not be found automatically.\n" |
| "Install it with:\n" |
| " pip install git+https://github.com/USER/stanno.git\n" |
| "Or clone the stanno repo and place this comfyui-stanno/ folder inside it." |
| ) |
|
|
|
|
| _ensure_stanno_importable() |
|
|
| from .nodes import ( |
| comfy_entrypoint, |
| STANNOLoad, |
| STANNOTrainImages, |
| STANNOScoreImages, |
| STANNODreamCond, |
| STANNODynamicLoRA, |
| STANNOCompositeCheck, |
| STANNOScan, |
| STANNOCascadeLoad, |
| STANNOCascadeTrainImages, |
| ) |
|
|
| |
| NODE_CLASS_MAPPINGS = { |
| "STANNOLoad": STANNOLoad, |
| "STANNOTrainImages": STANNOTrainImages, |
| "STANNOScoreImages": STANNOScoreImages, |
| "STANNODreamCond": STANNODreamCond, |
| "STANNODynamicLoRA": STANNODynamicLoRA, |
| "STANNOCompositeCheck": STANNOCompositeCheck, |
| "STANNOScan": STANNOScan, |
| "STANNOCascadeLoad": STANNOCascadeLoad, |
| "STANNOCascadeTrainImages": STANNOCascadeTrainImages, |
| } |
|
|
| NODE_DISPLAY_NAME_MAPPINGS = { |
| "STANNOLoad": "STANNO Loader", |
| "STANNOTrainImages": "STANNO Train from Images", |
| "STANNOScoreImages": "STANNO Image Scorer", |
| "STANNODreamCond": "STANNO Dream Conditioning", |
| "STANNODynamicLoRA": "STANNO Dynamic LoRA", |
| "STANNOCompositeCheck": "STANNO Composite Style Checker", |
| "STANNOScan": "STANNO Scan (DSANNO)", |
| "STANNOCascadeLoad": "STANNO Cascade Loader", |
| "STANNOCascadeTrainImages": "STANNO Cascade Train from Images", |
| } |
|
|
| __all__ = [ |
| "comfy_entrypoint", |
| "NODE_CLASS_MAPPINGS", |
| "NODE_DISPLAY_NAME_MAPPINGS", |
| ] |
|
|