$ cat workspace-template.yaml

T

Template Generazione Vestiario per Avatar

// Selezione gender Avatar e conseguente generazione di vestiario e accessoristica

Media Production

// Canvas Preview

canvas.flow

// Instruction

instruction.md

Template Generazione Vestiario per Avatar

Overview

This workflow automates the generation of photorealistic clothing and accessory assets for virtual avatars. It takes a gender selection as input, merges it with specialized clothing and accessory prompt templates, and uses a high-performance image generation service to produce high-quality, top-down "flat lay" images suitable for digital dressing.

Workflow Chain

[Avatar Gender Selection]  -> [Prompt Clothes - Female]    -> [Clothes Name - Plain View]  -> [Prompt Accessories - Female]    -> [Accessories - Plain View]

Node Reference

  • Avatar Gender Selection
    • What it does: Provides the base gender/identity text (e.g., "female" or "male") to influence the prompts.
    • Inputs from: User/Manual input.
    • Configurable inputs: value (Text).
    • Output: value (Text).
  • Prompt Clothes - Female
    • What it does: Merges the gender text with a detailed clothing description template.
    • Inputs from: Avatar Gender Selection.
    • Configurable inputs: text1 (Gender), text2 (Clothing Template).
    • Output: text (Merged Prompt).
  • Prompt Accessories - Female
    • What it does: Merges the gender text with a detailed accessory description template.
    • Inputs from: Avatar Gender Selection.
    • Configurable inputs: text1 (Gender), text2 (Accessory Template).
    • Output: text (Merged Prompt).
  • Clothes Name - Plain View
    • What it does: Generates a photorealistic image of the clothing items.
    • Inputs from: Prompt Clothes - Female.
    • Configurable inputs: prompt (Text), aspect_ratio (Number), megapixel (Number), seed_mode (Select).
    • Output: image (Image), resolution (String), aspect_ratio (Number).
  • Accessories - Plain View
    • What it does: Generates a photorealistic image of the accessory items.
    • Inputs from: Prompt Accessories - Female.
    • Configurable inputs: prompt (Text), aspect_ratio (Number), megapixel (Number), seed_mode (Select).
    • Output: image (Image), resolution (String), aspect_ratio (Number).

Execution Strategy

You MUST complete all 2 phases in order: Phase 1 -> Phase 2. Do NOT skip any phase.

Phase 1: Configuration & Decision

  1. Call requestUserDecision to gather all necessary parameters for the generation:
    • "What is the target gender for the avatar? (e.g., female, male, non-binary)" (Context: Determines the base prompt text).
    • "What specific clothing items should be generated? (e.g., a blue summer dress, a formal tuxedo)" (Context: Replaces the default clothing template).
    • "What specific accessories should be generated? (e.g., gold jewelry, leather belts)" (Context: Replaces the default accessory template).
    • "Select desired Aspect Ratio (e.g., 1:1, 9:16, 16:9)" (Context: Sets the image dimensions). Phase 1 complete. Now proceed to Phase 2. Do NOT skip to Phase Z.

Phase 2: Generation Pipeline

  1. Use upsertNode to configure Avatar Gender Selection with the chosen gender.
  2. Use upsertNode to configure Prompt Clothes - Female by merging the gender with the user's clothing description.
  3. Use upsertNode to configure Prompt Accessories - Female by merging the gender with the user's accessory description.
  4. Use upsertNode to configure Clothes Name - Plain View using the merged clothing prompt and the chosen aspect ratio.
  5. Use upsertNode to configure Accessories - Plain View using the merged accessory prompt and the chosen aspect ratio. 7 Use nodeExecutor to run the Clothes Name - Plain View node.
  6. Use nodeExecutor to run the Accessories - Plain View node.
  7. Use verification to ensure both images were generated successfully. Phase 2 complete. Now proceed to followUp. Do NOT skip to Phase Z.

Configuration Tips

User saysConfigure
"Make it for a man"Avatar Gender Selection: value = "male"
"Use a portrait ratio"Clothes Name - Plain View: aspect_ratio = 0.6667 (2:3)
"High resolution"Clothes Name - Plain View: megapixel = 2 or 4
"Keep the same look"Clothes Name - Plain View: seed_mode = "fixed"

Error Handling

ErrorCauseFix
Image Generation TimeoutHigh megapixel setting or server loadReduce megapixel or retry
Prompt MismatchGender text doesn't match clothing description (e.g., "male" + "women's suit")Ensure text2 in Merge nodes is updated to match gender
Node Connection ErrorMissing edge between prompt and image nodeUse upsertEdge to reconnect text to prompt

Re-editable artifacts

Incremental Edits to an Existing Canvas

  • Detection — If the nodes already exist, perform an EDIT using upsertNode and upsertEdge to update values rather than recreating the whole structure.
  • Add / remove / reorder recipes — If the user wants to add a third category (e.g., "Footwear"), use sectionFinder + sectionManager(ungroup, { sectionId }) -> organizeNodes -> sectionManager(group, { nodeIds, label }) -> autoLayout().
  • Post-edit — After any manual tweak to a prompt or setting, re-run the verification step and ask the user if they wish to re-generate the images.

// Dependencies

requirements.py
1from process import ImageCreation2from input import Text3from process import TextMerge