8.7 KiB
Introduction
Some nodes for stable diffusion comfyui.Sometimes it helps conveniently to use less nodes for doing the same things.
If you use workflow in my "blogs" repo, you need to dowmload these nodes.I don't guarantee that the nodes will stay the same always. Some nodes maybe have been changed if you update the new version.
How to install
The repo
The same with others custom nodes. Just cd custom_nodes and then git clone.
Translator model
If you use prompt translator to translate Chinese to English offline, you need download some models. Download the translator models from https://huggingface.co/facebook/mbart-large-50-many-to-one-mmt/tree/main into folder named "model" of this repo. The model folder tree of this repo: model/ └── mbart-large-50-many-to-many-mmt__only_to_English/ ├── pytorch_model.bin ├── config.json ├── sentencepiece.bpe.model ├── special_tokens_map.json ├── tmp2l0rt359 └── tokenizer_config.json
Environments
cd (this repo) pip install -r requirements.txt
Nodes Introductions
tdxh_image
- "TdxhImageToSize": TdxhImageToSize can Convert an image to size.
- "TdxhImageToSizeAdvanced":TdxhImageToSizeAdvanced can Convert an image to size and it will let you choose what to follow:"only_width", "only_height", "both_width_and_height","width * height", "only_ratio","only_image","get_SDXL_best_size".
tdxh_model
- "TdxhLoraLoader": TdxhLoraLoader adds a switch to the "LoraLoader", which shows as "bool_int" (0 -> OFF, 1 -> ON), and lets you choose "only_strength_both" or "strength_model_and_strength_clip".
tdxh_data
- "TdxhIntInput": TdxhIntInput returns the "INT" type.
- "TdxhFloatInput": TdxhFloatInput returns the "FLOAT" type.
- "TdxhStringInput": TdxhStringInput returns the "STRING" type.
- "TdxhSaveText": TdxhSaveText saves input text to an output text file and returns both the input text and the saved path as "STRING" outputs.
- "TdxhStringInputTranslator": TdxhStringInputTranslator returns the translated "STRING" type. (You need to download the translator model.)
tdxh_bool
- "TdxhOnOrOff": TdxhOnOrOff returns the "NUMBER" and "INT" type. When switching to ON, it returns 1; when switching to OFF, it returns 0.
- "TdxhBoolNumber": TdxhBoolNumber is similar to TdxhOnOrOff but lets you choose what to follow. "control_by_master" is the main control: if OFF, it returns "bool_int"; if ON, then only when both "bool_int_from_master" and "bool_int" are 1 does it return 1.
tdxh_efficiency
- "TdxhClipVison": TdxhClipVison adds a switch to the "CLIPVisionLoader" and the "clip_vision".
- "TdxhControlNetProcessor": TdxhControlNetProcessor adds a switch to ControlNet nodes and lets you preprocess the image. (It needs AUX preprocessor nodes.)
- "TdxhControlNetApply": TdxhControlNetApply adds a switch to ControlNet nodes and makes them more efficient to use.
- "TdxhReference": TdxhReference makes the "reference_only" node more efficient.
- "TdxhImg2ImgLatent": TdxhImg2ImgLatent can switch between original(main) latent and image latent (OFF -> main latent, ON -> image latent).
tdxh_ltx23
- "TdxhLtx23MultimodalDirector": TdxhLtx23MultimodalDirector is a multimodal control hub for LTX 2.3 style workflows. It accepts text, a dynamic image sequence, optional reference audio, and optional reference video frames, then outputs a ready-to-use positive prompt, negative prompt, modality-specific guidance strings, and a structured JSON control plan. The node is meant to sit upstream of LTX prompt/conditioning workflows so users can keep character consistency, scene continuity, voice or ambience guidance, and video style/camera/rhythm guidance in one place.
API nodes
DeepSeek API nodes
This repo now includes:
TdxhDeepSeekChat
Config priority:
- environment variable
DEEPSEEK_API_KEY - local file
deepseek_config.json
You can create deepseek_config.json from deepseek_config.example.json:
{
"api_key": "sk-your-deepseek-api-key",
"base_url": "https://api.deepseek.com",
"timeout_seconds": 120
}
Notes:
TdxhDeepSeekChatoutputsanswer,reasoning,statusTdxhDeepSeekChatnow has athinking_enabledtoggle, switching betweendeepseek-chatanddeepseek-reasonerTdxhDeepSeekChatauto-enables JSON mode when the prompt clearly asks for JSON output- both nodes support optional multi-round history with
keep_history clear_historyclears the stored conversation state inside the node instance- config files are stored under
api_nodes/configs/
Kimi API nodes
This repo now also includes:
TdxhKimiChatTdxhKimiDynamicVisionChatTdxhLocalQwenVLDynamicVisionChat
Config priority:
- environment variable
MOONSHOT_API_KEY - environment variable
KIMI_API_KEY - local file
kimi_config.json
You can create kimi_config.json from kimi_config.example.json:
{
"api_key": "sk-your-moonshot-api-key",
"base_url": "https://api.moonshot.ai/v1",
"chat_model": "kimi-k2-turbo-preview",
"thinking_model": "kimi-k2.5",
"vision_model": "moonshot-v1-8k-vision-preview",
"timeout_seconds": 120
}
Notes:
TdxhKimiChatdefaults to a faster Moonshot chat model for non-thinking text requests and keepskimi-k2.5for thinking requestsTdxhKimiChatcan disable thinking by sendingthinking: {"type":"disabled"}TdxhKimiChatalready has athinking_enabledtoggle in the node UITdxhKimiDynamicVisionChatsupports a dynamic number of image inputs with anUpdate inputsbutton- dynamic image inputs allow trailing image inputs to be empty, but do not allow gaps in the middle; if
image_4is connected thenimage_1toimage_3must also be connected TdxhKimiDynamicVisionChatrequires Moonshot Open Platform endpoints, not the Kimi Code endpointTdxhLocalQwenVLDynamicVisionChatwraps the localComfyUI-QwenVLGGUF backend under the tdxh naming conventionTdxhLocalQwenVLDynamicVisionChatsupports dynamic image inputs with anUpdate inputsbutton and also accepts one fixed optionalvideoinputTdxhLocalQwenVLDynamicVisionChatallows images and the fixed video input to be used together in one local multimodal requestTdxhLocalQwenVLDynamicVisionChatdoes not add extra pip dependencies inside this repo, but it requires the externalComfyUI-QwenVLplugin to be installedTdxhLocalQwenVLDynamicVisionChatalso depends on that plugin's GGUF vision runtime, such as a vision-capablellama-cpp-pythonbuild and matching QwenVL GGUF/mmproj model files- ComfyUI placeholder images coming from
LoadImage(example.png)are treated as empty image inputs, including common resize-like preprocessing results TdxhKimiDynamicVisionChatuploads valid images to Moonshot Files and reuses them viams://file_idfor lower request overhead on repeated calls- both nodes output
reasoning_contentwhen the model returns it - if
keep_historyis enabled, the node storesreasoning_contentin assistant history to follow Moonshot's thinking-model guidance - config files are stored under
api_nodes/configs/
Multi-platform fallback node
This repo also includes:
TdxhMultiPlatformChatTdxhMultiPlatformDynamicVisionChat
Features:
- supports provider priority ordering with
provider_1,provider_2, andprovider_3 provider_3defaults todisabledso the node structure can stay stable for future expansion- current providers:
deepseek,kimi,LocalQwen3VL-8B-Instruct-Q4_K_M,LocalQwen3VL-8B-Thinking-Q8_0 - in
TdxhMultiPlatformChat, the twoLocalQwen3VLentries are exposed for consistent provider lists but return a clear vision-only unsupported status - reserved for future extension by adding more providers
- automatically falls back to the next provider when the previous one returns a non-OK status
- outputs:
answerreasoningstatusused_providerattempt_log
Vision notes:
TdxhMultiPlatformDynamicVisionChatsupports dynamic image inputs with anUpdate inputsbuttonTdxhMultiPlatformDynamicVisionChatsupportskimi,LocalQwen3VL-8B-Instruct-Q4_K_M, andLocalQwen3VL-8B-Thinking-Q8_0in the same fallback chain, and also accepts one fixed optionalvideoinput- if all connected images are placeholders such as
LoadImage(example.png), the node treats them as empty and falls back to text chat deepseekis kept as a reserved provider slot but returns an explicit unsupported error until DeepSeek publishes official public vision API documentation
Thanks
Some codes are from The official ComfyUI and other custom nodes like The was-node-suite-comfyui. The translator's main code is from prompt_translator.