ComfyUI-SwissArmyKnife / docs /examples /WORKFLOW_DEMO.md
aliensmn's picture
Mirror from https://github.com/sammykumar/ComfyUI-SwissArmyKnife
0997c23 verified

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   β”‚    β”‚ Show Text   β”‚
β”‚             │────▢│                         │────▢│             β”‚
β”‚ [Load your  β”‚    β”‚ - API Key: [your key]   β”‚    β”‚ Displays    β”‚
β”‚  test image]β”‚    β”‚ - Model: gemini-2.5-    β”‚    β”‚ final       β”‚
β”‚             β”‚    β”‚   flash                 β”‚    β”‚ generated   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚ - System Prompt: [...]  β”‚    β”‚ prompt      β”‚
                   β”‚ - User Prompt: [...]    β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚                         β”‚
                   β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
                   β”‚ β”‚ final_string widget β”‚ β”‚  ← This widget will
                   β”‚ β”‚ (will auto-update)  β”‚ β”‚     populate after
                   β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚     execution!
                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

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
    • Show Text: This will display the final output
  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
    • The Show Text node should display the same text
    • 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!