KJNodes/maskinggenerated

(Down)load CLIPSeg(DownloadAndLoadCLIPSeg)

This node downloads the model from the specified model repository using the `huggingface_hub` library and stores it in the `models/clip_seg` directory of ComfyUI.

Download And Load CLIP Seg

clipseg_model
model
COMBO
KJNodes

The (Down)load CLIPSeg node downloads a model from a specified model repository via the huggingface_hub library and stores it in the models/clip_seg directory of ComfyUI.

The (Down)load CLIPSeg node is a utility node for fetching and loading CLIPSeg models. Its core function is to download a specified CLIPSeg model from the Hugging Face Hub and load it into ComfyUI for subsequent text-prompt-based image segmentation tasks. This node simplifies the model deployment process, eliminating the need for users to manually handle model files.

Node Functionality

This node downloads a model from a specified model repository via the huggingface_hub library and stores it in ComfyUI's models/clip_seg directory. It supports loading two different versions of the CLIPSeg model, including the refined version and the FP16-optimized version. The node internally integrates the CLIPSegForImageSegmentation model and the CLIPSegProcessor processor, packaging them into a dictionary object for output. This provides complete processing capabilities for subsequent mask generation nodes.

Node Parameter Description - (Down)load CLIPSeg

Control Parameters (Parameters)

Parameter NameData TypeRequiredDefault ValueValue Range/OptionsDescription
modelCOMBOYesKijai/clipseg-rd64-refined-fp16"Kijai/clipseg-rd64-refined-fp16", "CIDAS/clips...Input parameter model: Select the CLIPSeg model version to download and load. Options are Kijai/clipseg-rd64-refined-fp16 (FP16 precision version) or CIDAS/clipseg-rd64-refined (refined version).

Output

Parameter NameData TypeDescription
clipseg_modelCLIPSEGMODELOutput parameter clipseg_model: Outputs the loaded CLIPSeg model and its processor for use by subsequent mask generation nodes.

Usage Scenarios

In image editing or content generation workflows, you can use this node as the starting point of your pipeline. First, use this node to load a CLIPSeg model, then connect the output model object to a node such as "CLIPSeg Masking". Simultaneously, provide an image and a text description to that masking node to generate a mask corresponding to the text for the image region, which can be used for subsequent inpainting or special effects application.

Notes

This node requires an internet connection to download model files; the first use of a specific model will involve download time. Downloaded model files are permanently saved locally, and subsequent runs do not require re-downloading. Please ensure you have sufficient disk space for the models.

The (Down)load CLIPSeg node is from the ComfyUI-KJNodes node package.

Comments

Sign in with GitHub to join the discussion.

Loading comments…