Nodes/Comfyui_CXH_joy_caption/Joy_caption_alpha_prompt
ComfyUI Node

Joy_caption_alpha_prompt

JoyCaption's 9 modes and 17 toggles, without the copy-paste

By StartHua·Created 2 years ago·Updated 2 years ago· 624
Joy_caption_alpha_prompt
    • STRING
    caption_type
    caption_length
    name
    [如果图像中有人物/角色,你必须用name来指代他们。] If there is a person/character in the image you must refer to them as *name* .false
    [不要包含无法改变的人物/角色信息如:种族、性别等,但要包含可以改变的属性如:发型。] Do NOT include information about people/characters that cannot be changed (like ethnicity, gender, etc), but do still include changeable attributes (like hair style).false
    [包含关于光线的信息] Include information about lighting.false
    [包含关于相机角度的信息] Include information about camera angle.false
    [包含关于是否有水印的信息] Include information about whether there is a watermark or not.false
    [包含关于是否有JPEG压缩痕迹的信息] Include information about whether there are JPEG artifacts or not.false
    [如果是照片,你必须包含可能使用的相机类型以及诸如光圈、快门速度、ISO等细节信息] If it is a photo you MUST include information about what camera was likely used and details such as aperture, shutter speed, ISO, etc.false
    [不要包含任何性相关的内容;保持内容适合全年龄] Do NOT include anything sexual; keep it PG.false
    [不要提及图像的分辨率] Do NOT mention the image's resolution.false
    [你必须包含关于图像主观审美质量的评价,从低到非常高] You MUST include information about the subjective aesthetic quality of the image from low to very high.false
    [包含关于图像构图风格的信息,如引导线、三分法或对称性] Include information on the image's composition style, such as leading lines, rule of thirds, or symmetry.false
    [不要提及图像中的任何文字] Do NOT mention any text that is in the image.false
    [指明景深以及背景是否聚焦或模糊] Specify the depth of field and whether the background is in focus or blurred.false
    [如果适用,提及可能使用的人工或自然光源] If applicable, mention the likely use of artificial or natural lighting sources.false
    [不要使用任何模棱两可的语言] Do NOT use any ambiguous language.false
    [包含图像是否适合工作场合(sfw)、暗示性的还是不适合工作场合(nsfw)] Include whether the image is sfw, suggestive, or nsfw.false
    [只描述图像中最重要的元素] ONLY describe the most important elements of the image.false

    If you've ever stared at the JoyCaption Alpha Two demo and wished you could grab those preset captioning modes without hand-typing them, this is the node for you. Joy_caption_alpha_prompt is a glorified prompt builder: it takes a caption style, a length, and a bunch of optional instruction toggles, and outputs one ready-to-use instruction string for Joy_caption_alpha_run or the batch nodes.

    It's the difference between captioning your training set as a generic "describe this image" and telling the model exactly how you want it to write - which is a much bigger deal than it sounds for dataset quality. The same caption model produces very different training captions depending on whether you ask for a "Training Prompt", "Booru tag list", or "Product Listing".

    How it works

    This is a straight port of the Alpha Two mode system: nine caption types map to template sentences, and the length picker slots into a word-count phrase. The magic is the toggle list - seventeen optional instructions (each one also carries a Chinese translation, a nod to the author's audience) that get appended to the base prompt when you flip them on. Want the captioner to mention lighting and camera angle but never mention resolution? Tick those boxes. The node strips the brackets from the option text and stitches everything together, then substitutes any *name* placeholder with whatever you put in the name field.

    The inputs you'll actually touch

    • caption_type - nine modes: Descriptive, Descriptive (Informal), Training Prompt, MidJourney, Booru tag list, Booru-like tag list, Art Critic, Product Listing, Social Media Post. For training datasets, "Training Prompt" is the crowd favorite; Booru modes give you tag-style output.
    • caption_length - "any", the adjectives (very short → very long), or exact word counts (20/50/80/100/120/250/500). Numeric lengths enforce a word count; adjectives ask for a vibe.
    • name - a character name to substitute in. Several toggles only make sense if you set this.

    Then the ~17 toggles. The ones that matter most for training: "Do NOT include information about people/characters that cannot be changed (like ethnicity, gender)" and "If there is a person/character in the image you must refer to them as name". For a character LoRA you generally want the former on and the person's changeable attributes described, exactly like the KB's captioning advice: describe what you want to stay variable, leave permanent traits undescribed.

    • Output: a single STRING - your built prompt. Wire it into Joy_caption_alpha_run's prompt input or the batch nodes' prompt.

    Installing

    Same as the rest of the pack - ComfyUI Manager (search "Comfyui_CXH_joy_caption") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/StartHua/Comfyui_CXH_joy_caption
    cd Comfyui_CXH_joy_caption
    python -m pip install -r requirements.txt
    

    Restart and you're done. This node has no model dependencies at all - it's pure string assembly - so it works even before you've downloaded the caption weights.

    Notes

    • The mode + instruction combo is the same system that shipped in the real Alpha Two release, so results track what you'd see in the fancyfeast demo space.
    • One honest caveat: Alpha Two occasionally ignores an instruction or loops in the more exotic modes. That's the model's known quirk (later Beta One releases were trained specifically to fix it), not a bug in this node - re-roll the seed if a toggle seems ignored.
    CategoryCXH/LLM

    Inputs (20)

    NameTypeDefaultDescription
    caption_typeCOMBO9 options: Descriptive, Descriptive (Informal), Training Prompt, MidJourney, Booru tag list, Booru-like tag list, +3
    caption_lengthCOMBO13 options: any, very short, short, medium-length, long, very long, +7
    nameSTRING
    [如果图像中有人物/角色,你必须用name来指代他们。] If there is a person/character in the image you must refer to them as *name* .BOOLEANfalse
    [不要包含无法改变的人物/角色信息如:种族、性别等,但要包含可以改变的属性如:发型。] Do NOT include information about people/characters that cannot be changed (like ethnicity, gender, etc), but do still include changeable attributes (like hair style).BOOLEANfalse
    [包含关于光线的信息] Include information about lighting.BOOLEANfalse
    [包含关于相机角度的信息] Include information about camera angle.BOOLEANfalse
    [包含关于是否有水印的信息] Include information about whether there is a watermark or not.BOOLEANfalse
    [包含关于是否有JPEG压缩痕迹的信息] Include information about whether there are JPEG artifacts or not.BOOLEANfalse
    [如果是照片,你必须包含可能使用的相机类型以及诸如光圈、快门速度、ISO等细节信息] If it is a photo you MUST include information about what camera was likely used and details such as aperture, shutter speed, ISO, etc.BOOLEANfalse
    [不要包含任何性相关的内容;保持内容适合全年龄] Do NOT include anything sexual; keep it PG.BOOLEANfalse
    [不要提及图像的分辨率] Do NOT mention the image's resolution.BOOLEANfalse
    [你必须包含关于图像主观审美质量的评价,从低到非常高] You MUST include information about the subjective aesthetic quality of the image from low to very high.BOOLEANfalse
    [包含关于图像构图风格的信息,如引导线、三分法或对称性] Include information on the image's composition style, such as leading lines, rule of thirds, or symmetry.BOOLEANfalse
    [不要提及图像中的任何文字] Do NOT mention any text that is in the image.BOOLEANfalse
    [指明景深以及背景是否聚焦或模糊] Specify the depth of field and whether the background is in focus or blurred.BOOLEANfalse
    [如果适用,提及可能使用的人工或自然光源] If applicable, mention the likely use of artificial or natural lighting sources.BOOLEANfalse
    [不要使用任何模棱两可的语言] Do NOT use any ambiguous language.BOOLEANfalse
    [包含图像是否适合工作场合(sfw)、暗示性的还是不适合工作场合(nsfw)] Include whether the image is sfw, suggestive, or nsfw.BOOLEANfalse
    [只描述图像中最重要的元素] ONLY describe the most important elements of the image.BOOLEANfalse

    Outputs (1)

    NameTypeDescription
    STRINGSTRING