diff --git a/__init__.py b/__init__.py index a75f57e..c71e32e 100644 --- a/__init__.py +++ b/__init__.py @@ -26,6 +26,296 @@ SXCP_CHARACTER_CAST = "SXCP_CHARACTER_CAST" SXCP_CHARACTER_SLOT = "SXCP_CHARACTER_SLOT" SXCP_CHARACTER_PROFILE = "SXCP_CHARACTER_PROFILE" + +COMMON_INPUT_TOOLTIPS = { + "row_number": "Generation row to use. Changing it advances the deterministic selection without changing the main seed.", + "start_index": "Metadata/output index offset only. It does not limit category pools or random choices.", + "seed": "Main seed used when no more specific seed config overrides an axis.", + "global_seed": "One seed that locks all prompt axes so the same inputs can recreate the same result.", + "base_seed": "Base seed used by Seed Locker before applying a selected reroll axis.", + "reroll_seed": "Seed for the selected reroll axis. Use -1 to derive it from the base seed.", + "category": "Main category source. Use category config nodes for cleaner workflow wiring.", + "subcategory": "Specific subcategory, or random to choose within the selected category.", + "category_config": "Category/subcategory config from SxCP Category Preset.", + "cast_config": "Cast size config from SxCP Cast Control.", + "generation_profile": "General style/intensity profile from SxCP Generation Profile.", + "filter_config": "Ethnicity/body filter config. Ethnicity List can feed this too.", + "ethnicity_list": "Optional ethnicity pool. When connected, it overrides the slot or generator ethnicity picker.", + "seed_config": "Per-axis seed config. Connect Global Seed, Seed Locker, or Seed Control here.", + "camera_config": "Camera config used by the prompt formatter when camera mode is from_camera_config.", + "softcore_camera_config": "Camera config used only for the softcore Insta/OF prompt. Falls back to camera_config if empty.", + "hardcore_camera_config": "Camera config used only for the hardcore Insta/OF prompt. Falls back to camera_config if empty.", + "character_profile": "Saved or loaded single-character profile. Character slots override this for configured casts.", + "character_cast": "Chain character slots here. The node closest to the final generator becomes the next auto_chain label.", + "character_slot": "Single slot payload for saving/loading profiles or debugging one character.", + "hardcore_position_config": "Hardcore action/position config. Chain Position Pool into Action Filter, then into the generator.", + "metadata_json": "Structured metadata from an SxCP generator. Prefer this over raw prompt text for formatters and profile save.", + "source_text": "Raw prompt, caption, or metadata JSON depending on input_hint.", + "input_hint": "Tells the node how to interpret source_text. auto tries metadata first.", + "target": "For dual prompts, choose which side to output as the main Krea prompt.", + "detail_level": "Controls how much detail the rewriter keeps. concise is shorter, dense keeps more clauses.", + "style_mode": "How strongly the formatter rewrites visual style terms.", + "preserve_trigger": "Keep the trigger token in the formatted prompt instead of stripping it.", + "negative_prompt": "Negative prompt text to pass through or merge with generated negatives.", + "extra_positive": "Extra positive text appended after the generated prompt.", + "extra_negative": "Extra negative text appended after the generated negative prompt.", + "trigger": "Training or style trigger token.", + "prepend_trigger_to_prompt": "If enabled, put the trigger token at the start of generated prompts.", + "enabled": "Enable this node's effect while keeping it wired in the graph.", + "combine_mode": "replace starts a new pool/config; add merges selected values into the incoming config.", + "manual": "Manual character details config. Non-empty manual fields override generated slot details.", + "characteristics": "Chainable character characteristic pool such as age/body/eyes/clothing.", + "hair_config": "Chainable hair pool. Combine length, color, and style nodes before the character slot.", + "summary": "Human-readable description of the config produced by this node.", + "status": "Operation result or warning text.", + "profile_name": "Name of the profile to save, load, rename, or delete.", + "manual_profile_name": "Free-text profile name used when profile_name is set to manual.", + "fallback_profile_json": "Profile JSON to use when a named profile cannot be loaded.", + "rename_to": "New profile name used only when rename_now is enabled.", + "save_now": "Writes the profile to disk only when enabled. Keep off while adjusting fields.", + "delete_now": "Deletes the selected profile when enabled.", + "rename_now": "Renames the selected profile when enabled.", + "source": "Where the save node reads character data from.", + "subject_type": "Character type for this slot or saved profile.", + "label": "Character label. auto_chain assigns the next Woman/Man label based on incoming cast order.", + "slot_seed": "Per-character seed. Use -1 to follow the generator person seed.", + "age": "Age choice for this slot. Use Age Range node for a custom random age pool.", + "manual_age": "Exact age phrase override, for example '32-year-old adult'.", + "ethnicity": "Ethnicity choice for this slot. A connected Ethnicity List overrides this picker.", + "figure": "General figure bias for generated body descriptors.", + "figure_bias": "Woman-slot figure bias. Body pool can give more precise body choices.", + "women_count": "Number of women in the generated cast when no Insta/OF preset overrides it.", + "men_count": "Number of men in the generated cast when no Insta/OF preset overrides it.", + "hardcore_women_count": "Number of women in the hardcore cast when hardcore_cast is use_counts.", + "hardcore_men_count": "Number of men in the hardcore cast when hardcore_cast is use_counts.", + "body": "Body choice for this slot. A Body Pool node can replace the random list.", + "manual_body": "Exact body phrase override.", + "body_phrase": "Full custom body wording. Use only when the body picker is not specific enough.", + "skin": "Manual skin/complexion phrase.", + "hair": "Manual hair phrase. Hair config nodes are better for controlled random choices.", + "eyes": "Manual eye description.", + "descriptor_detail": "How detailed this character's descriptor should be. Men usually work better compact.", + "expression_enabled": "Master expression toggle for this generator or character.", + "expression_intensity": "Expression intensity from 0 to 1. Use -1 on slots to inherit the generator setting.", + "softcore_expression_intensity": "Optional expression intensity override for this character in softcore prompts. -1 inherits.", + "hardcore_expression_intensity": "Optional expression intensity override for this character in hardcore prompts. -1 inherits.", + "presence_mode": "Controls whether the character is visible, implied POV, or otherwise present.", + "softcore_outfit": "Manual softcore outfit text for this character.", + "hardcore_clothing": "Manual hardcore clothing/body exposure text for this character.", + "custom_softcore_outfits": "One custom softcore outfit per line. Used when softcore_source is custom.", + "custom_hardcore_clothing": "One custom hardcore clothing/body exposure state per line.", + "condition": "Loop condition. When false, the loop stops and passes current values through.", + "total": "Total number of loop iterations.", + "skip": "Number of leading loop indexes to skip. skip=1 starts generation at index 2.", + "collection": "Existing accumulated value or batch.", + "value": "Value to append, store, or pass through.", + "store_key": "Accumulator memory key. Same key shares stored entries across executions.", + "action": "Accumulator operation: append, replace, clear, read, or append a variant.", + "max_items": "Maximum stored entries kept in this accumulator.", + "image_batch_mode": "How image entries are batched when dimensions differ.", + "skip_empty": "Ignore empty inputs instead of adding blank entries.", + "image": "Image to store in the accumulator.", + "entry_id": "Stable ID used for replace_by_entry_id or grouping variants.", + "entry_tag": "Optional suffix added to entry_id.", + "clothing": "Built-in clothing density for legacy direct generation. Category/profile nodes can override this.", + "poses": "Built-in pose pool for legacy direct generation.", + "backside_bias": "Legacy bias toward rear/backside poses where that category supports it.", + "minimal_clothing_ratio": "Legacy weighted ratio override. -1 keeps the category/profile default.", + "standard_pose_ratio": "Legacy weighted ratio override. -1 keeps the category/profile default.", + "profile": "Generation profile preset for broad style, clothing, pose, and expression defaults.", + "clothing_override": "Override the profile clothing setting, or leave profile_default.", + "poses_override": "Override the profile pose setting, or leave profile_default.", + "trigger_policy": "Controls whether the profile prepends the trigger token.", + "cast_mode": "Preset cast shape. Custom counts are used when the preset allows them.", + "preset": "Category preset for common workflow lanes.", + "camera_mode": "Camera style preset.", + "shot_size": "How much of the body/frame should be visible.", + "angle": "Camera angle relative to the subject.", + "lens": "Lens wording to include in the prompt.", + "distance": "Camera distance wording.", + "orientation": "Horizontal/vertical framing wording.", + "phone_visibility": "Whether the prompt mentions a visible/hidden phone.", + "priority": "How strictly the prompt should enforce the camera wording.", + "camera_detail": "off omits camera text, compact keeps one line, full emits detailed camera wording.", + "subject_focus": "Optional camera focus phrase, such as face/body/contact emphasis.", + "strict_excludes": "When enabled, only selected ethnicity groups are used. When off, selections act more like soft includes.", + "min_age": "Minimum adult age in this custom age pool.", + "max_age": "Maximum adult age in this custom age pool.", + "softcore_source": "Softcore outfit source for this character. custom reads custom_softcore_outfits.", + "hardcore_state": "Hardcore clothing/body exposure state for this character.", + "softcore_expression_enabled": "Enable expression text in the softcore prompt.", + "hardcore_expression_enabled": "Enable expression text in the hardcore prompt.", + "flow": "Loop flow-control socket. Wire from the matching loop start node.", + "collection_mode": "How the loop end collects per-iteration values.", + "skip_none": "Do not add empty values to the collection.", + "collected": "Current accumulated value carried through the loop.", + "collect_value": "Value captured from the current loop iteration.", + "a": "First integer/boolean helper input.", + "b": "Second integer/boolean helper input.", +} + +NODE_INPUT_TOOLTIPS = { + "SxCPSeedControl": { + "category_seed_mode": "auto/follow_main follows the main seed; fixed uses category_seed; random rerolls this axis each queue.", + "subcategory_seed_mode": "Controls which subcategory is selected. Change this to switch oral vs penetration when both are allowed.", + "content_seed_mode": "Controls item/outfit content for non-pose categories.", + "person_seed_mode": "Controls generated character appearance unless a slot seed overrides it.", + "scene_seed_mode": "Controls location/scene selection.", + "pose_seed_mode": "Controls pose/item selection for pose categories, including hardcore positions.", + "role_seed_mode": "Controls role assignment and secondary action details.", + "expression_seed_mode": "Controls selected expression text.", + "composition_seed_mode": "Controls framing/composition text.", + }, + "SxCPSeedLocker": { + "reroll_axis": "Choose the one axis to change while the rest stays locked. Use pose for sexual pose, scene for location, person for appearance.", + }, + "SxCPCameraControl": { + "camera_mode": "Camera style preset. Use from_camera_config in Insta/OF options to consume this.", + "priority": "locked makes the camera wording strict; soft_hint allows the model more freedom.", + "camera_detail": "off omits camera text, compact keeps one short line, full emits detailed camera constraints.", + "phone_visibility": "Use phone_hidden or suppress_phone_visibility when you do not want 'phone hidden' text in prompts.", + }, + "SxCPCameraOrbitControl": { + "horizontal_angle": "Orbit angle in degrees. 0=front, 90=right side, 180=back, 270=left side.", + "vertical_angle": "Camera elevation. Negative looks up, positive looks down.", + "zoom": "Maps to distance/framing when framing is from_zoom.", + "framing": "How zoom should be translated into shot size/distance wording.", + "include_degrees": "Include numeric degree wording in addition to human camera direction.", + }, + "SxCPQwenCameraTranslator": { + "qwen_prompt": "Camera prompt from Qwen MultiAngle, for example ' front-right quarter view eye-level shot medium shot'.", + "camera_info": "Optional structured camera_info from Qwen MultiAngle. Used before qwen_prompt when prefer_camera_info is true.", + "prefer_camera_info": "Use structured camera_info values when available instead of parsing the text prompt.", + "suppress_phone_visibility": "Avoid adding phone visibility text unless you explicitly set a phone option.", + }, + "SxCPHardcorePositionPool": { + "family": "Restrict the broad hardcore family. Use any when you want oral and penetration to both be possible.", + "combine_mode": "replace discards incoming position choices; add merges these choices with the incoming config.", + "hardcore_position_config": "Optional incoming config. Usually connect previous Position Pool here only when chaining pools.", + }, + "SxCPHardcoreActionFilter": { + "focus": "keep_pool preserves/broadens the incoming pool; *_only modes force one action family.", + "allow_toys": "Allow toy/strap-on wording in hardcore actions.", + "allow_double": "Allow double-penetration or second-contact wording.", + "allow_penetration": "Allow vaginal/penetrative sex subcategories.", + "allow_oral": "Allow oral sex subcategories.", + "allow_anal": "Allow anal subcategories.", + "allow_climax": "Allow cumshot/climax aftermath subcategories.", + }, + "SxCPInstaOFOptions": { + "softcore_cast": "solo keeps softcore focused on Woman A; same_as_hardcore includes the same cast as the hardcore prompt.", + "hardcore_cast": "use_counts reads hardcore_women_count/hardcore_men_count; presets set the counts automatically.", + "softcore_level": "Controls the soft prompt exposure/outfit level.", + "hardcore_level": "Controls how explicit the hardcore prompt style is.", + "platform_style": "Instagram/OnlyFans styling bias for the dual prompt pair.", + "continuity": "Whether the softcore and hardcore prompts share the room/creator setup.", + "hardcore_clothing_continuity": "How clothing carries from softcore to hardcore. explicit_nude omits clothing references.", + "softcore_camera_mode": "Camera mode for the softcore prompt, or from_camera_config.", + "hardcore_camera_mode": "Camera mode for the hardcore prompt. same_as_softcore reuses the softcore setting.", + "camera_detail": "Global camera verbosity for the pair unless a camera config overrides it.", + "hardcore_detail_density": "How dense the hardcore action sentence should be in the Krea formatter.", + }, + "SxCPInstaOFPromptPair": { + "options_json": "Options from SxCP Insta/OF Options. If empty, defaults are used.", + "ethnicity": "Fallback ethnicity when no filter/ethnicity list or character slots are connected.", + "figure": "Fallback figure bias when no character slot overrides it.", + }, + "SxCPPromptBuilderFromConfigs": { + "seed": "Main seed. Connect Seed Config for per-axis control.", + }, + "SxCPCharacterProfileSave": { + "profile_name": "Profile filename stem. Saving requires save_now=true.", + "metadata_json": "Use generator metadata to save the currently generated character without regenerating it.", + "character_slot": "Use this when saving a configured slot directly.", + }, + "SxCPCharacterProfileLoad": { + "enabled": "When false, outputs an empty profile and leaves downstream generation unchanged.", + "override_age": "Optional loaded-profile override. Empty keeps the profile value.", + "override_body": "Optional body override. Empty keeps the profile value.", + "override_descriptor_detail": "Override descriptor verbosity while keeping the rest of the loaded profile.", + }, + "SxCPKrea2Formatter": { + "metadata_json": "Best input for Krea2 formatting because it preserves cast, camera, and hardcore action metadata.", + }, + "SxCPCaptionNaturalizer": { + "style_policy": "drop_style_tail removes training/style boilerplate; keep_style_terms preserves more of it.", + "include_trigger": "Add the naturalizer trigger to the rewritten caption.", + }, + "SxCPForLoopStart": { + "index": "Output loop index. First generated index is skip + 1.", + "collected": "Current accumulated value carried through the loop.", + }, + "SxCPLoopAppend": { + "mode": "auto_batch tries tensor/latent batching first, then falls back to a list.", + }, + "SxCPAccumulator": { + "image_batch_mode": "same_size_only keeps incompatible sizes separate; resize_to_first forces one image batch.", + }, +} + + +def _tooltip_for_input(node_name: str, input_name: str) -> str: + node_tooltips = NODE_INPUT_TOOLTIPS.get(node_name, {}) + if input_name in node_tooltips: + return node_tooltips[input_name] + if input_name in COMMON_INPUT_TOOLTIPS: + return COMMON_INPUT_TOOLTIPS[input_name] + if input_name.endswith("_seed_mode"): + axis = input_name[: -len("_seed_mode")] + return f"How the {axis} seed is resolved: follow the main seed, use the fixed field, or reroll randomly." + if input_name.endswith("_seed"): + axis = input_name[: -len("_seed")] + return f"Fixed {axis} seed value. Used only when the matching seed mode is fixed, or as a fallback for auto modes." + if input_name.startswith("include_"): + value = input_name[len("include_") :].replace("_", " ") + return f"Include {value} in this random pool." + if input_name.startswith("initial_value"): + return "Carry value passed into the loop body and returned on the matching output." + if input_name.startswith("override_"): + return "Optional loaded-profile override. Leave empty or keep_profile to preserve the profile value." + return "" + + +def _copy_input_spec_with_tooltip(input_spec, tooltip: str): + if not tooltip or not isinstance(input_spec, tuple): + return input_spec + if len(input_spec) >= 2 and isinstance(input_spec[1], dict): + options = dict(input_spec[1]) + options.setdefault("tooltip", tooltip) + return (input_spec[0], options, *input_spec[2:]) + if len(input_spec) == 1: + return (input_spec[0], {"tooltip": tooltip}) + return input_spec + + +def _inject_input_tooltips(input_types: dict, node_name: str) -> dict: + patched = dict(input_types) + for group_name in ("required", "optional"): + group = patched.get(group_name) + if not isinstance(group, dict): + continue + patched_group = {} + for input_name, input_spec in group.items(): + patched_group[input_name] = _copy_input_spec_with_tooltip( + input_spec, + _tooltip_for_input(node_name, input_name), + ) + patched[group_name] = patched_group + return patched + + +def _install_input_tooltips(node_classes: dict[str, type]) -> None: + for node_name, node_class in node_classes.items(): + original = getattr(node_class, "INPUT_TYPES", None) + if original is None or getattr(node_class, "_sxcp_tooltips_installed", False): + continue + + def input_types(cls, _original=original, _node_name=node_name): + return _inject_input_tooltips(_original(), _node_name) + + node_class.INPUT_TYPES = classmethod(input_types) + node_class._sxcp_tooltips_installed = True + try: from .loop_nodes import ANY_TYPE, LOOP_NODE_CLASS_MAPPINGS, LOOP_NODE_DISPLAY_NAME_MAPPINGS from .prompt_builder import ( @@ -2033,6 +2323,7 @@ NODE_CLASS_MAPPINGS = { "SxCPInstaOFPromptPair": SxCPInstaOFPromptPair, } NODE_CLASS_MAPPINGS.update(LOOP_NODE_CLASS_MAPPINGS) +_install_input_tooltips(NODE_CLASS_MAPPINGS) NODE_DISPLAY_NAME_MAPPINGS = { "SxCPPromptBuilder": "SxCP Prompt Builder",