Nodes/comfyui_cv/CV Save Classifier
ComfyUI Node

CV Save Classifier

Writes a trained classifier to ComfyUI/models/cvml as a gzip-compressed '.yml.gz' file, so a model trained once ('CV Train Classifier' model_yaml output) can be reloaded in a LATER workflow by 'CV Predict Classifier'. The content is the standard OpenCV StatModel YAML (KNN/SVM models embed their training data - gzip shrinks them ~10x); to use it outside ComfyUI, gunzip first, then cv2.ml.SVM_load & co. read it. An existing file of the same name is overwritten (deterministic re-runs). An EMPTY model_yaml (a trainer that reported success=false) writes nothing and flags saved=false instead of raising. This is an output node: it runs even with nothing wired downstream.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Save Classifier
    • filename
    • saved
    model_yaml
    filenameclassifier
    Categoryimage/CV/ml

    Inputs (2)

    NameTypeDefaultDescription
    model_yamlSTRINGThe model_yaml output of 'CV Train Classifier' (loadable OpenCV YAML text).
    filenameSTRINGclassifierFile name inside models/cvml; '.yml.gz' is appended if missing, path components are stripped.

    Outputs (2)

    NameTypeDescription
    filenameSTRINGName of the file written inside models/cvml - the same string the 'model' combo of 'CV Predict Classifier' lists after a page reload ('' when nothing was saved). The folder it lives in is deliberately NOT part of it: an absolute path leaving the node would end up in shared workflow JSON and pasted previews, carrying the drive layout, install location and user name with it.
    savedBOOLEANFalse when model_yaml was empty (the trainer failed upstream) - nothing was written.