mirror of
https://github.com/vegu-ai/talemate.git
synced 2026-09-02 20:20:40 +02:00
240 lines
9.6 KiB
Markdown
240 lines
9.6 KiB
Markdown
|
|
# Visualizer Agent Prompt Nodes
|
||
|
|
|
||
|
|
Build visual prompts: assemble prompt parts, apply styles, finalize prompts and unpack them into compiled positive/negative prompt strings. Generation itself happens through the [generation nodes](agents-visual-generation.md), and ready-made flows live in [Visualizer Agent Modules](agents-visual-modules.md).
|
||
|
|
|
||
|
|
!!! note "Apply Style behavior change in 0.39.0"
|
||
|
|
[Apply Style](#apply-style) now resolves its `template_id` directly to a style template. Passing the literal `UNSPECIFIED` as the template id no longer applies the configured art style — it applies nothing. For configuration-driven styles (the active art style, plus the subject style for a `vis_type`), use [Apply Styles](#apply-styles) instead.
|
||
|
|
|
||
|
|
<!-- glossary:generated - everything below this line is generated by `python -m talemate.game.engine.nodes.tools glossary --write` - do not edit -->
|
||
|
|
|
||
|
|
|
||
|
|
_8 nodes._
|
||
|
|
|
||
|
|
| Node | Registry path |
|
||
|
|
| --- | --- |
|
||
|
|
| [Apply Style](#apply-style) | `agents/visual/ApplyStyle` |
|
||
|
|
| [Apply Styles](#apply-styles) | `agents/visual/ApplyStyles` |
|
||
|
|
| [Visual Enum Values](#visual-enum-values) | `agents/visual/EnumValues` |
|
||
|
|
| [Finalize Prompt](#finalize-prompt) | `agents/visual/FinalizePrompt` |
|
||
|
|
| [Visual Prompt](#visual-prompt) | `agents/visual/Prompt` |
|
||
|
|
| [Visual Prompt Part](#visual-prompt-part) | `agents/visual/PromptPart` |
|
||
|
|
| [Visual Settings](#visual-settings) | `agents/visual/Settings` |
|
||
|
|
| [Unpack Visual Prompt](#unpack-visual-prompt) | `agents/visual/UnpackPrompt` |
|
||
|
|
|
||
|
|
## Apply Style
|
||
|
|
|
||
|
|
`agents/visual/ApplyStyle`
|
||
|
|
|
||
|
|
Applies a specific style template (by template id) to a visual prompt,
|
||
|
|
inserting it at the front of the prompt's part list and modifying the
|
||
|
|
prompt in place.
|
||
|
|
|
||
|
|
**Inputs**
|
||
|
|
|
||
|
|
| Input | Type | Description |
|
||
|
|
| --- | --- | --- |
|
||
|
|
| `state` | `any` | The graph state |
|
||
|
|
| `prompt` | `visual/prompt` | The visual prompt to apply the style to |
|
||
|
|
| `template_id` | `str` | The id of the style template to apply |
|
||
|
|
|
||
|
|
**Outputs**
|
||
|
|
|
||
|
|
| Output | Type | Description |
|
||
|
|
| --- | --- | --- |
|
||
|
|
| `state` | `any` | The graph state, passed through |
|
||
|
|
| `prompt` | `visual/prompt` | The prompt with the style applied |
|
||
|
|
| `template_id` | `str` | The template id, passed through |
|
||
|
|
| `prompt_part` | `visual/prompt_part` | The prompt part created from the style template (None if the template was not found) |
|
||
|
|
|
||
|
|
## Apply Styles
|
||
|
|
|
||
|
|
`agents/visual/ApplyStyles`
|
||
|
|
|
||
|
|
Applies the configured style templates to a visual prompt: the active
|
||
|
|
art style plus the subject style matching the given vis_type. Matching
|
||
|
|
styles are inserted at the front of the prompt's part list, modifying
|
||
|
|
the prompt in place.
|
||
|
|
|
||
|
|
**Inputs**
|
||
|
|
|
||
|
|
| Input | Type | Description |
|
||
|
|
| --- | --- | --- |
|
||
|
|
| `state` | `any` | The graph state |
|
||
|
|
| `prompt` | `visual/prompt` | The visual prompt to apply styles to |
|
||
|
|
| `vis_type` | `str` | The type of visual to apply styles for (optional) |
|
||
|
|
|
||
|
|
**Outputs**
|
||
|
|
|
||
|
|
| Output | Type | Description |
|
||
|
|
| --- | --- | --- |
|
||
|
|
| `state` | `any` | The graph state, passed through |
|
||
|
|
| `prompt` | `visual/prompt` | The prompt with the styles applied |
|
||
|
|
| `vis_type` | `str` | The vis_type, passed through |
|
||
|
|
|
||
|
|
**Properties**
|
||
|
|
|
||
|
|
| Property | Type | Default | Description |
|
||
|
|
| --- | --- | --- | --- |
|
||
|
|
| `vis_type` | `str` | `"UNSPECIFIED"` | The type of visual to apply styles to. Choices: `UNSPECIFIED`, `CHARACTER_CARD`, `CHARACTER_PORTRAIT`, `SCENE_CARD`, `SCENE_BACKGROUND`, `SCENE_ILLUSTRATION`, `OBJECT_ILLUSTRATION`. |
|
||
|
|
|
||
|
|
## Visual Enum Values
|
||
|
|
|
||
|
|
`agents/visual/EnumValues`
|
||
|
|
|
||
|
|
Returns the possible values of one of the visual agent's enums
|
||
|
|
(VIS_TYPE, GEN_TYPE, FORMAT_TYPE or PROMPT_TYPE), selected via the
|
||
|
|
enum property.
|
||
|
|
|
||
|
|
**Outputs**
|
||
|
|
|
||
|
|
| Output | Type | Description |
|
||
|
|
| --- | --- | --- |
|
||
|
|
| `values` | `list` | The list of the enum's values |
|
||
|
|
|
||
|
|
**Properties**
|
||
|
|
|
||
|
|
| Property | Type | Default | Description |
|
||
|
|
| --- | --- | --- | --- |
|
||
|
|
| `enum` | `str` | `"VIS_TYPE"` | The enum to get the values of. Choices: `VIS_TYPE`, `GEN_TYPE`, `FORMAT_TYPE`, `PROMPT_TYPE`. |
|
||
|
|
|
||
|
|
## Finalize Prompt
|
||
|
|
|
||
|
|
`agents/visual/FinalizePrompt`
|
||
|
|
|
||
|
|
Applies the visualizer's prompt finalization (post-processing actions)
|
||
|
|
to a positive / negative prompt string pair.
|
||
|
|
|
||
|
|
**Inputs**
|
||
|
|
|
||
|
|
| Input | Type | Description |
|
||
|
|
| --- | --- | --- |
|
||
|
|
| `state` | `any` | graph state (required — wire through any gating switch so the node is skipped when its output would be discarded) |
|
||
|
|
| `positive_prompt` | `str` | positive prompt string (required) |
|
||
|
|
| `negative_prompt` | `str` | negative prompt string (optional) |
|
||
|
|
| `vis_type` | `str` | type of visual the prompts are for (optional) |
|
||
|
|
| `character_name` | `str` | character the prompts involve, enables character level finalizers (optional) |
|
||
|
|
|
||
|
|
**Outputs**
|
||
|
|
|
||
|
|
| Output | Type | Description |
|
||
|
|
| --- | --- | --- |
|
||
|
|
| `state` | `any` | graph state (passed through) |
|
||
|
|
| `positive_prompt` | `str` | finalized positive prompt |
|
||
|
|
| `negative_prompt` | `str` | finalized negative prompt |
|
||
|
|
|
||
|
|
**Properties**
|
||
|
|
|
||
|
|
| Property | Type | Default | Description |
|
||
|
|
| --- | --- | --- | --- |
|
||
|
|
| `vis_type` | `str` | `"UNSPECIFIED"` | The type of visual the prompts are for. Choices: `UNSPECIFIED`, `CHARACTER_CARD`, `CHARACTER_PORTRAIT`, `SCENE_CARD`, `SCENE_BACKGROUND`, `SCENE_ILLUSTRATION`, `OBJECT_ILLUSTRATION`. |
|
||
|
|
|
||
|
|
## Visual Prompt
|
||
|
|
|
||
|
|
`agents/visual/Prompt`
|
||
|
|
|
||
|
|
Creates a visual prompt from a list of prompt parts. The prompt_type
|
||
|
|
controls how the parts are compiled into the final positive / negative
|
||
|
|
prompt strings (comma-separated keywords or descriptive prose).
|
||
|
|
|
||
|
|
**Inputs**
|
||
|
|
|
||
|
|
| Input | Type | Description |
|
||
|
|
| --- | --- | --- |
|
||
|
|
| `prompt_type` | `str` | (optional) The type of prompt to create (KEYWORDS or DESCRIPTIVE) |
|
||
|
|
| `parts` | `list` | (optional) List of visual prompt parts to combine |
|
||
|
|
|
||
|
|
**Outputs**
|
||
|
|
|
||
|
|
| Output | Type | Description |
|
||
|
|
| --- | --- | --- |
|
||
|
|
| `prompt` | `visual/prompt` | The created visual prompt |
|
||
|
|
|
||
|
|
**Properties**
|
||
|
|
|
||
|
|
| Property | Type | Default | Description |
|
||
|
|
| --- | --- | --- | --- |
|
||
|
|
| `prompt_type` | `str` | `"KEYWORDS"` | The type of prompt to create. Choices: `KEYWORDS`, `DESCRIPTIVE`. |
|
||
|
|
|
||
|
|
## Visual Prompt Part
|
||
|
|
|
||
|
|
`agents/visual/PromptPart`
|
||
|
|
|
||
|
|
Creates a visual prompt part from instructions, keyword lists and
|
||
|
|
descriptive text. Prompt parts are combined into a visual prompt (via the
|
||
|
|
Prompt node), which compiles the final positive / negative prompts from
|
||
|
|
them. Keyword inputs given as a single string are split on ", ", and
|
||
|
|
positive keywords prefixed with "no " (e.g. "no glasses") are treated as
|
||
|
|
implied negative keywords.
|
||
|
|
|
||
|
|
**Inputs**
|
||
|
|
|
||
|
|
| Input | Type | Description |
|
||
|
|
| --- | --- | --- |
|
||
|
|
| `instructions` | `str` | (optional) Free-form instructions for the prompt part |
|
||
|
|
| `positive_keywords_raw` | `list,str` | (optional) Positive keywords as a list or comma-separated string |
|
||
|
|
| `negative_keywords_raw` | `list,str` | (optional) Negative keywords as a list or comma-separated string |
|
||
|
|
| `positive_descriptive` | `str` | (optional) Descriptive (prose) positive prompt text |
|
||
|
|
| `negative_descriptive` | `str` | (optional) Descriptive (prose) negative prompt text |
|
||
|
|
|
||
|
|
**Outputs**
|
||
|
|
|
||
|
|
| Output | Type | Description |
|
||
|
|
| --- | --- | --- |
|
||
|
|
| `prompt_part` | `visual/prompt_part` | The created visual prompt part |
|
||
|
|
| `instructions` | `str` | The instructions (passed through) |
|
||
|
|
| `positive_keywords_raw` | `list` | Raw positive keywords, including any "no ..." entries |
|
||
|
|
| `negative_keywords_raw` | `list` | Raw negative keywords (passed through) |
|
||
|
|
| `implied_negative_keywords` | `list` | Keywords derived from "no ..." positive keywords |
|
||
|
|
| `positive_keywords` | `list` | Positive keywords with "no ..." entries removed |
|
||
|
|
| `negative_keywords` | `list` | Raw negative keywords plus the implied negative keywords |
|
||
|
|
| `positive_descriptive` | `str` | Descriptive positive text (passed through) |
|
||
|
|
| `negative_descriptive` | `str` | Descriptive negative text (passed through) |
|
||
|
|
|
||
|
|
**Properties**
|
||
|
|
|
||
|
|
| Property | Type | Default | Description |
|
||
|
|
| --- | --- | --- | --- |
|
||
|
|
| `instructions` | `text` | `""` | The instructions for the prompt part |
|
||
|
|
| `positive_keywords_raw` | `list` | `[]` | The positive keywords for the prompt part |
|
||
|
|
| `negative_keywords_raw` | `list` | `[]` | The negative keywords for the prompt part |
|
||
|
|
| `positive_descriptive` | `text` | `""` | The positive descriptive for the prompt part |
|
||
|
|
| `negative_descriptive` | `text` | `""` | The negative descriptive for the prompt part |
|
||
|
|
|
||
|
|
## Visual Settings
|
||
|
|
|
||
|
|
`agents/visual/Settings`
|
||
|
|
|
||
|
|
Base node to render visual agent settings.
|
||
|
|
|
||
|
|
Every setting of the visual agent is exposed as an output socket named after the setting - see the agent's documentation under [Agents](../../../agents/index.md) for what each setting does.
|
||
|
|
|
||
|
|
## Unpack Visual Prompt
|
||
|
|
|
||
|
|
`agents/visual/UnpackPrompt`
|
||
|
|
|
||
|
|
Unpacks a visual prompt into its parts and the compiled prompt strings.
|
||
|
|
Use this to access the final positive / negative prompts (built according
|
||
|
|
to the prompt's prompt_type) or the keyword-only / descriptive-only
|
||
|
|
variants regardless of the prompt type.
|
||
|
|
|
||
|
|
**Inputs**
|
||
|
|
|
||
|
|
| Input | Type | Description |
|
||
|
|
| --- | --- | --- |
|
||
|
|
| `prompt` | `visual/prompt` | The visual prompt to unpack |
|
||
|
|
|
||
|
|
**Outputs**
|
||
|
|
|
||
|
|
| Output | Type | Description |
|
||
|
|
| --- | --- | --- |
|
||
|
|
| `prompt` | `visual/prompt` | The visual prompt (passed through) |
|
||
|
|
| `parts` | `list` | The prompt's list of prompt parts |
|
||
|
|
| `prompt_type` | `str` | The prompt type (KEYWORDS or DESCRIPTIVE) |
|
||
|
|
| `instructions` | `str` | Combined instructions from all parts |
|
||
|
|
| `positive_prompt` | `str` | Positive prompt compiled according to prompt_type |
|
||
|
|
| `negative_prompt` | `str` | Negative prompt compiled according to prompt_type |
|
||
|
|
| `positive_prompt_keywords` | `str` | Positive prompt compiled as comma-separated keywords |
|
||
|
|
| `negative_prompt_keywords` | `str` | Negative prompt compiled as comma-separated keywords |
|
||
|
|
| `positive_prompt_descriptive` | `str` | Positive prompt compiled as descriptive text |
|
||
|
|
| `negative_prompt_descriptive` | `str` | Negative prompt compiled as descriptive text |
|