Files
JeyzerMC-comfyui-flakes/__init__.py
T
Mehdi Chaid 2390c94654 feat: add Preview Flake Data node with 4-item info grid
- Python backend: new PreviewFlakeData class that takes FLAKE_DATA input
  and passes it through unchanged, marked as OUTPUT_NODE for execution
- JavaScript frontend: custom widget showing a 2x2 grid with Models,
  Prompts, Parameters, and Metadata categories
- Clicking a category card opens an overlay with consolidated information
- Handles combo node scenarios by displaying all available data fields
- Registers the new node in __init__.py NODE_CLASS_MAPPINGS

Closes #122
2026-05-13 12:42:54 -04:00

57 lines
2.2 KiB
Python

import os
import folder_paths
FLAKES_DIR = os.path.join(folder_paths.models_dir, "flakes")
os.makedirs(FLAKES_DIR, exist_ok=True)
if "flakes" in folder_paths.folder_names_and_paths:
existing_paths, existing_exts = folder_paths.folder_names_and_paths["flakes"]
if FLAKES_DIR not in existing_paths:
existing_paths.append(FLAKES_DIR)
existing_exts.update({".yaml", ".yml"})
else:
folder_paths.folder_names_and_paths["flakes"] = ([FLAKES_DIR], {".yaml", ".yml"})
PRESETS_DIR = os.path.join(FLAKES_DIR, "model_presets")
os.makedirs(PRESETS_DIR, exist_ok=True)
if "model_presets" in folder_paths.folder_names_and_paths:
existing_paths, existing_exts = folder_paths.folder_names_and_paths["model_presets"]
if PRESETS_DIR not in existing_paths:
existing_paths.append(PRESETS_DIR)
existing_exts.update({".yaml", ".yml"})
else:
folder_paths.folder_names_and_paths["model_presets"] = ([PRESETS_DIR], {".yaml", ".yml"})
from .full_flake_node import FlakeModelPreset, FlakeStack, FlakeCombo, FlakeModelCombo # noqa: E402
from .flake_data_nodes import FlakeDataSplitAll, FlakeDataSplitSelect, IntoFlakeDataAll, IntoFlakeDataSelect, PreviewFlakeData # noqa: E402
from . import flake_server # noqa: E402,F401 — registers aiohttp routes on import
NODE_CLASS_MAPPINGS = {
"FlakeModelPreset": FlakeModelPreset,
"FlakeStack": FlakeStack,
"FlakeCombo": FlakeCombo,
"FlakeModelCombo": FlakeModelCombo,
"FlakeDataSplitAll": FlakeDataSplitAll,
"FlakeDataSplitSelect": FlakeDataSplitSelect,
"IntoFlakeDataAll": IntoFlakeDataAll,
"IntoFlakeDataSelect": IntoFlakeDataSelect,
"PreviewFlakeData": PreviewFlakeData,
}
NODE_DISPLAY_NAME_MAPPINGS = {
"FlakeModelPreset": "Flake Model Preset",
"FlakeStack": "Flake Stack",
"FlakeCombo": "Flake Combo",
"FlakeModelCombo": "Flake Model Combo",
"FlakeDataSplitAll": "Flake Data Split (All)",
"FlakeDataSplitSelect": "Flake Data Split (Select)",
"IntoFlakeDataAll": "Into Flake Data (All)",
"IntoFlakeDataSelect": "Into Flake Data (Select)",
"PreviewFlakeData": "Preview Flake Data",
}
WEB_DIRECTORY = "./web"
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS", "WEB_DIRECTORY"]