tdxh_node_comfyui
Add Switch on nodes, Make nodes amount small! It helps conveniently to use less nodes for doing the same things.
Nodes (16)
The AND-gate that lets one switch rule a whole branch
CLIP vision conditioning in one node — and yes, the name's a typo
ControlNet loader and applier fused, with an off switch
Resize and preprocess for ControlNet in one node
A float in, a float out — the pack's consistency piece
One image in, every size type out
Size your SDXL latent without doing the math
A hardware switch between txt2img and img2img
An integer in, an integer out — why this node exists anyway
A LoRA loader you can switch off without rewiring
A dropdown that's secretly a 0 and a 1
Reference-only conditioning with a switch — bring your own helper pack
A single-line text source for when multiline gets in the way
Translate your prompt to English offline, on your own GPU
A per-branch switch that defers to the master
One boolean, three outputs, zero fuss
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 add a switch to the "LoraLoader", which shows as "bool_int" ( 0 -> OFF , 1 -> ON ), and when you set the strength it will let you choose what to follow: "only_strength_both", "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. "TdxhStringInputTranslator":TdxhStringInputTranslator returns the "STRING" type that has been translated. (You need to download Translator model!)
tdxh_bool
"TdxhOnOrOff":TdxhOnOrOff returns the "NUMBER" and "INT" type. When switching to ON, it will return 1, when switching to OFF, it will return 0. "TdxhBoolNumber":TdxhBoolNumber is the same as TdxhOnOrOff but let you choose what to follow: "control_by_master" is the main control, if OFF, return "bool_int",if ON, then only both "bool_int_from_master" and "bool_int" are 1, retrun 1.
tdxh_efficiency
"TdxhClipVison" : TdxhClipVison add a switch to the "CLIPVisionLoader" and the "clip_vision". "TdxhControlNetProcessor":TdxhControlNetProcessor add a switch to ControlNet nodes and let you can preprocess the image.(It needs AUX preprocessor nodes.) "TdxhControlNetApply":TdxhControlNetApply add a switch to ControlNet nodes and make it efficiently. "TdxhReference":TdxhReference make "reference_only" node more efficiently. "TdxhImg2ImgLatent":TdxhImg2ImgLatent can switch between original(main) Latent and Image Latent ( OFF -> main Latent , ON -> Image Latent ).
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.