Files
sammykumar-ComfyUI-SwissArm…/dev-docs/examples/WORKFLOW_DEMO.md
T

2.5 KiB

Final String Widget Demo Workflow

This shows how to set up a workflow to test the final_string widget functionality:

┌─────────────┐    ┌─────────────────────────┐
│ Load Image  │    │ Gemini Image Describe   │
│             │────▶│                         │
│ [Load your  │    │ - API Key: [your key]   │
│  test image]│    │ - Model: gemini-2.5-    │
│             │    │   flash                 │
└─────────────┘    │ - System Prompt: [...]  │
                   │ - User Prompt: [...]    │
                   │                         │
                   │ ┌─────────────────────┐ │
                   │ │ final_string widget │ │  ← This widget auto-
                   │ │ (will auto-update)  │ │     populates after
                   │ └─────────────────────┘ │     execution!
                   └─────────────────────────┘
                                       │
                                       ▼
                         (Optional) connect `final_string`
                         to any built-in ComfyUI text display node
                         if you want it rendered outside the Gemini node.

Step-by-step Instructions:

  1. Import the workflow:

    • Copy the contents of example_workflow.json
    • In ComfyUI, go to "Load" → "Load (from file)" or drag the JSON file
  2. Set up the nodes:

    • Load Image: Choose any test image
    • Gemini Image Describe: Enter your valid Gemini API key
    • (Optional) add a built-in ComfyUI text output node (e.g., Text/Note) and wire it to final_string if you want the caption outside of the Gemini panel
  3. Execute the workflow:

    • Click "Queue Prompt" to run the workflow
    • Wait for the Gemini API to process the image
  4. Check the results:

    • The final_string widget on the Gemini node should populate with generated text
    • Optional downstream text nodes should mirror the same string
    • Browser console should show "Updated final_string widget with:" message

What was fixed:

  • ❌ Before: final_string widget showed placeholder text
  • ✅ After: final_string widget shows actual generated description

The widget update happens automatically when the node execution completes!