Files
archiLaws AdminandClaude Opus 4.7 b17a7ae5d0 fix: set DISPLAY fallback before importing pyautogui
mouseinfo (pyautogui dependency) accesses os.environ['DISPLAY'] at
module level, which raises KeyError when ComfyUI runs headless.
Use setdefault to provide a fallback value without overwriting
an existing DISPLAY setting.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-12 11:24:16 +08:00

41 lines
1.2 KiB
Python

import os as _os
_os.environ.setdefault('DISPLAY', ':0')
import pyautogui
import comfy
import comfy.utils
from .screenshots import Screenshots
from .queue_sequence import QueueSequence
from .dummy_input import dummyInput
from .boolean_jumper import BooleanJumper
from .text_batch_load_path import TextBatchLoadPath
Screenshots.CATEGORY = "SillyNode"
QueueSequence.CATEGORY = "SillyNode"
dummyInput.CATEGORY = "SillyNode"
BooleanJumper.CATEGORY = "SillyNode"
NODE_CLASS_MAPPINGS = {
"Screenshots|SillyNode": Screenshots,
"QueueSequence|SillyNode": QueueSequence,
"dummyInput|SillyNode": dummyInput,
"BooleanJumper|SillyNode": BooleanJumper,
"TextBatchLoadPath|SillyNode": TextBatchLoadPath
}
NODE_DISPLAY_NAME_MAPPINGS = {
"Screenshots|SillyNode": "Screen Shots",
"QueueSequence|SillyNode": "Queue Sequence",
"dummyInput|SillyNode": "Dummy Input",
"BooleanJumper|SillyNode": "Boolean Jumper",
"TextBatchLoadPath|SillyNode": "Text Batch Load (Path)"
}
# WEB_DIRECTORY is the comfyui nodes directory that ComfyUI will link and auto-load.
WEB_DIRECTORY = "./js"
__all__ = [NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS]