Upload Auto_IMGBatch_Dataset_Captioning.json
Browse filesThis workflow automatically generates clean, structured image captions by combining WD14 tagging, Florence-style natural language descriptions, and a custom trigger token for training consistency. The idea behind this workflow is to deliver proven results for easily (one-click) captioning datasets for training. I have made many high quality LORA from the datasets this workflow outputs.
Designed for:
Dataset preparation
LoRA / model training
Caption inspection & QA
Prompt reconstruction workflows
The examples shown are direct outputs from the workflow, displayed exactly as generated. No LLM or API keys needed. If you’re tired of messy captions or inconsistent datasets, this keeps everything clean, readable, and repeatable in one easy simple workflow.
What This Workflow Does
Uses WD14 to extract high-quality tag metadata
Uses Florence to generate a natural-language image description
Injects a custom trigger token at the start of every caption
Outputs both tags + descriptive text in a single caption block
Saves captions to a user-defined folder inside ComfyUI/output
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"id":"1405193f-9068-49ed-90cf-ac0138aac1fd","revision":0,"last_node_id":97,"last_link_id":201,"nodes":[{"id":29,"type":"Florence2Run","pos":[2289.3955200694836,160.50527979076705],"size":[400,364],"flags":{},"order":6,"mode":0,"inputs":[{"localized_name":"image","name":"image","type":"IMAGE","link":156},{"localized_name":"florence2_model","name":"florence2_model","type":"FL2MODEL","link":42},{"localized_name":"text_input","name":"text_input","type":"STRING","widget":{"name":"text_input"},"link":null},{"localized_name":"task","name":"task","type":"COMBO","widget":{"name":"task"},"link":null},{"localized_name":"fill_mask","name":"fill_mask","type":"BOOLEAN","widget":{"name":"fill_mask"},"link":null},{"localized_name":"keep_model_loaded","name":"keep_model_loaded","shape":7,"type":"BOOLEAN","widget":{"name":"keep_model_loaded"},"link":null},{"localized_name":"max_new_tokens","name":"max_new_tokens","shape":7,"type":"INT","widget":{"name":"max_new_tokens"},"link":null},{"localized_name":"num_beams","name":"num_beams","shape":7,"type":"INT","widget":{"name":"num_beams"},"link":null},{"localized_name":"do_sample","name":"do_sample","shape":7,"type":"BOOLEAN","widget":{"name":"do_sample"},"link":null},{"localized_name":"output_mask_select","name":"output_mask_select","shape":7,"type":"STRING","widget":{"name":"output_mask_select"},"link":null},{"localized_name":"seed","name":"seed","shape":7,"type":"INT","widget":{"name":"seed"},"link":null}],"outputs":[{"localized_name":"image","name":"image","type":"IMAGE","links":null},{"localized_name":"mask","name":"mask","type":"MASK","links":null},{"localized_name":"caption","name":"caption","type":"STRING","links":[59]},{"localized_name":"data","name":"data","type":"JSON","links":null}],"properties":{"cnr_id":"comfyui-florence2","ver":"1.0.6","Node name for S&R":"Florence2Run","widget_ue_connectable":{}},"widgets_values":["","more_detailed_caption",true,false,1024,3,true,"",491023779361234,"randomize"]},{"id":30,"type":"DownloadAndLoadFlorence2Model","pos":[2339.4558337358676,-31.39382448575173],"size":[319.463623046875,130],"flags":{},"order":0,"mode":0,"inputs":[{"localized_name":"lora","name":"lora","shape":7,"type":"PEFTLORA","link":null},{"localized_name":"model","name":"model","type":"COMBO","widget":{"name":"model"},"link":null},{"localized_name":"precision","name":"precision","type":"COMBO","widget":{"name":"precision"},"link":null},{"localized_name":"attention","name":"attention","type":"COMBO","widget":{"name":"attention"},"link":null},{"localized_name":"convert_to_safetensors","name":"convert_to_safetensors","shape":7,"type":"BOOLEAN","widget":{"name":"convert_to_safetensors"},"link":null}],"outputs":[{"localized_name":"florence2_model","name":"florence2_model","type":"FL2MODEL","links":[42]}],"properties":{"cnr_id":"comfyui-florence2","ver":"1.0.6","Node name for S&R":"DownloadAndLoadFlorence2Model","widget_ue_connectable":{}},"widgets_values":["gokaygokay/Florence-2-SD3-Captioner","fp16","sdpa",false]},{"id":92,"type":"StringConcatenate","pos":[2698.6205328306546,-76.72485621434907],"size":[400,200],"flags":{},"order":8,"mode":0,"inputs":[{"localized_name":"string_a","name":"string_a","type":"STRING","widget":{"name":"string_a"},"link":180},{"localized_name":"string_b","name":"string_b","type":"STRING","widget":{"name":"string_b"},"link":181},{"localized_name":"delimiter","name":"delimiter","type":"STRING","widget":{"name":"delimiter"},"link":null}],"outputs":[{"localized_name":"STRING","name":"STRING","type":"STRING","links":[198]}],"properties":{"cnr_id":"comfy-core","ver":"0.3.75","Node name for S&R":"StringConcatenate","widget_ue_connectable":{}},"widgets_values":["","",", "]},{"id":95,"type":"StringConcatenate","pos":[2692.645732311333,-341.3581871869255],"size":[400,200],"flags":{},"order":9,"mode":0,"inputs":[{"localized_name":"string_a","name":"string_a","type":"STRING","widget":{"name":"string_a"},"link":197},{"localized_name":"string_b","name":"string_b","type":"STRING","widget":{"name":"string_b"},"link":198},{"localized_name":"delimiter","name":"delimiter","type":"STRING","widget":{"name":"delimiter"},"link":null}],"outputs":[{"localized_name":"STRING","name":"STRING","type":"STRING","links":[199]}],"properties":{"cnr_id":"comfy-core","ver":"0.3.75","Node name for S&R":"StringConcatenate","widget_ue_connectable":{}},"widgets_values":["","",", "]},{"id":86,"type":"SaveImageTextDataSetToFolder","pos":[3117.4153493673957,-341.61564310257626],"size":[341.9200042724609,106],"flags":{},"order":10,"mode":0,"inputs":[{"localized_name":"images","name":"images","type":"IMAGE","link":159},{"localized_name":"texts","name":"texts","type":"STRING","widget":{"name":"texts"},"link":199},{"localized_name":"folder_name","name":"folder_name","type":"STRING","widget":{"name":"folder_name"},"link":200},{"localized_name":"filename_prefix","name":"filename_prefix","type":"STRING","widget":{"name":"filename_prefix"},"link":201}],"outputs":[],"properties":{"cnr_id":"comfy-core","ver":"0.3.75","Node name for S&R":"SaveImageTextDataSetToFolder","widget_ue_connectable":{}},"widgets_values":["","dataset","image"]},{"id":87,"type":"LoadImageDataSetFromFolder","pos":[1630.3202581746252,-86.6732191187475],"size":[300.7800048828125,58],"flags":{},"order":1,"mode":0,"inputs":[{"localized_name":"folder","name":"folder","type":"COMBO","widget":{"name":"folder"},"link":null}],"outputs":[{"localized_name":"images","name":"images","shape":6,"type":"IMAGE","links":[155,156,159]}],"title":"LOAD IMAGE FOLDER","properties":{"cnr_id":"comfy-core","ver":"0.3.75","Node name for S&R":"LoadImageDataSetFromFolder","widget_ue_connectable":{}},"widgets_values":["Captions"]},{"id":96,"type":"JjkText","pos":[1630.4243500671394,38.2039885513225],"size":[288.0753601098852,133.01012167553057],"flags":{},"order":2,"mode":0,"inputs":[{"localized_name":"text","name":"text","type":"STRING","widget":{"name":"text"},"link":null}],"outputs":[{"localized_name":"text","name":"text","type":"STRING","links":[200]}],"title":"OUTPUT FOLDER NAME","properties":{"cnr_id":"ComfyUI-Jjk-Nodes","ver":"b3c99bb78a99551776b5eab1a820e1cd58f84f31","Node name for S&R":"JjkText","widget_ue_connectable":{}},"widgets_values":["Dataset"]},{"id":97,"type":"JjkText","pos":[1631.941353886088,227.75466357982947],"size":[288.0753601098852,133.01012167553057],"flags":{},"order":3,"mode":0,"inputs":[{"localized_name":"text","name":"text","type":"STRING","widget":{"name":"text"},"link":null}],"outputs":[{"localized_name":"text","name":"text","type":"STRING","links":[201]}],"title":"OUTPUT IMAGE FILE NAME","properties":{"cnr_id":"ComfyUI-Jjk-Nodes","ver":"b3c99bb78a99551776b5eab1a820e1cd58f84f31","Node name for S&R":"JjkText","widget_ue_connectable":{}},"widgets_values":["Test"]},{"id":36,"type":"ShowText|pysssss","pos":[2715.9325321822703,199.23731664148718],"size":[267.7736270966411,328.9381648804666],"flags":{},"order":7,"mode":0,"inputs":[{"localized_name":"text","name":"text","type":"STRING","link":59}],"outputs":[{"localized_name":"STRING","name":"STRING","shape":6,"type":"STRING","links":[181]}],"properties":{"cnr_id":"comfyui-custom-scripts","ver":"1.2.5","Node name for S&R":"ShowText|pysssss","widget_ue_connectable":{}},"widgets_values":["A woman is sitting on a gray couch. She is wearing a long sleeve white shirt and blue jeans. The woman has long brown hair that is pulled back into her face. Her eyes are open and her mouth is slightly open. A white lamp is hanging from the ceiling over the couch. Part of a white wall can be seen behind the woman. A brown cabinet is sitting against the wall behind the sofa.","A woman is standing in an office. She is wearing a long sleeve white button down shirt. She has long brown hair that is pulled back into a ponytail. The woman is wearing dark blue jeans with a silver watch on her left wrist. Her hands are clasped in front of her body. The room is filled with office furniture, including a desk with a black computer monitor and keyboard on it. There is a large window on the wall behind the woman.","A woman is standing on a paved walkway. She is wearing a gray jacket over a black tank top and black pants. Her shoes are black and white with black laces. The woman has long brown hair that is pulled back in a ponytail. There is a field of green grass behind the woman. Part of a tree trunk can be seen behind the field. A white road is running across the field of grass.","A woman is standing on a sidewalk. She is wearing a long sleeve gray shirt and blue jeans. Her shoes are black with a white stripe on the bottom. A black pole is standing behind the woman. Cars are parked on the side of the road. A man in a black shirt and black pants is walking on the sidewalk. A yellow sign is standing in front of the man. Part of a tree can be seen behind the car in the background."]},{"id":37,"type":"JjkText","pos":[1635.3393436512201,-288.19793568416384],"size":[288.0753601098852,133.01012167553057],"flags":{},"order":4,"mode":0,"inputs":[{"localized_name":"text","name":"text","type":"STRING","widget":{"name":"text"},"link":null}],"outputs":[{"localized_name":"text","name":"text","type":"STRING","links":[197]}],"title":"LORA TRIGGER WORD","properties":{"cnr_id":"ComfyUI-Jjk-Nodes","ver":"b3c99bb78a99551776b5eab1a820e1cd58f84f31","Node name for S&R":"JjkText","widget_ue_connectable":{}},"widgets_values":["TRIGGER"]},{"id":8,"type":"WD14Tagger|pysssss","pos":[1989.1671142578125,-17.052446365356445],"size":[286.35033193898107,538.0990427655515],"flags":{},"order":5,"mode":0,"inputs":[{"localized_name":"image","name":"image","type":"IMAGE","link":155},{"localized_name":"model","name":"model","type":"COMBO","widget":{"name":"model"},"link":null},{"localized_name":"threshold","name":"threshold","type":"FLOAT","widget":{"name":"threshold"},"link":null},{"localized_name":"character_threshold","name":"character_threshold","type":"FLOAT","widget":{"name":"character_threshold"},"link":null},{"localized_name":"replace_underscore","name":"replace_underscore","type":"BOOLEAN","widget":{"name":"replace_underscore"},"link":null},{"localized_name":"trailing_comma","name":"trailing_comma","type":"BOOLEAN","widget":{"name":"trailing_comma"},"link":null},{"localized_name":"exclude_tags","name":"exclude_tags","type":"STRING","widget":{"name":"exclude_tags"},"link":null}],"outputs":[{"localized_name":"STRING","name":"STRING","shape":6,"type":"STRING","links":[180]}],"properties":{"cnr_id":"comfyui-wd14-tagger","ver":"1.0.0","Node name for S&R":"WD14Tagger|pysssss","widget_ue_connectable":{}},"widgets_values":["wd-convnext-tagger-v3",0.35,0.85,false,false,"","1girl, solo, long_hair, looking_at_viewer, brown_hair, long_sleeves, sitting, brown_eyes, parted_lips, pants, indoors, blurry, sweater, pillow, blurry_background, denim, couch, jeans, blue_pants, realistic, photorealistic","1girl, solo, long_hair, looking_at_viewer, shirt, brown_hair, jewelry, brown_eyes, white_shirt, pants, indoors, necklace, lips, chair, denim, desk, watch, jeans, realistic, wristwatch, office_chair, office, photorealistic","1girl, solo, looking_at_viewer, brown_hair, brown_eyes, standing, jacket, full_body, outdoors, earrings, open_clothes, shoes, pants, hood, black_footwear, blurry, tree, lips, blurry_background, grass, sneakers, realistic, photorealistic","1girl, looking_at_viewer, shirt, brown_hair, jewelry, brown_eyes, standing, full_body, outdoors, shoes, solo_focus, pants, black_footwear, necklace, blurry, black_shirt, tree, blurry_background, denim, motor_vehicle, jeans, blue_pants, realistic, car, road, street"]}],"links":[[42,30,0,29,1,"FL2MODEL"],[59,29,2,36,0,"STRING"],[155,87,0,8,0,"IMAGE"],[156,87,0,29,0,"IMAGE"],[159,87,0,86,0,"IMAGE"],[180,8,0,92,0,"STRING"],[181,36,0,92,1,"STRING"],[197,37,0,95,0,"STRING"],[198,92,0,95,1,"STRING"],[199,95,0,86,1,"STRING"],[200,96,0,86,2,"STRING"],[201,97,0,86,3,"STRING"]],"groups":[],"config":{},"extra":{"ue_links":[],"ds":{"scale":0.9646149645000016,"offset":[-1507.7048381735653,453.40380171104204]},"links_added_by_ue":[],"workflowRendererVersion":"LG"},"version":0.4}
|