{
  "meta": {
    "model_name": "babyavatar",
    "model_type": "other",
    "version_id": "f879b89acc5b931e4d180de5ef0e89782a4937cd4ae1d59be9a502a01a7b8c8c",
    "model_owner": "babysea",
    "generated_at": "2025-08-01T14:50:46.292624"
  },
  "name": "babysea/babyavatar - Other Generator",
  "nodes": [
    {
      "id": "c17e4b00-1069-42e8-85c8-42a079f59f7b",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -896,
        -176
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "999f8aa2-5228-4c36-aa65-8d38783a1fce",
      "name": "Set API Token",
      "type": "n8n-nodes-base.set",
      "position": [
        -608,
        -80
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "api_token",
              "name": "api_token",
              "type": "string",
              "value": "YOUR_REPLICATE_API_TOKEN"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "7fb11481-8999-477e-87a4-309f702bd5e4",
      "name": "Set Other Parameters",
      "type": "n8n-nodes-base.set",
      "position": [
        -288,
        -128
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "api_token",
              "name": "api_token",
              "type": "string",
              "value": "={{ $('Set API Token').item.json.api_token }}"
            },
            {
              "id": "mask",
              "name": "mask",
              "type": "string",
              "value": "https://via.placeholder.com/512x512/000000/FFFFFF.png"
            },
            {
              "id": "seed",
              "name": "seed",
              "type": "number",
              "value": -1
            },
            {
              "id": "image",
              "name": "image",
              "type": "string",
              "value": "https://picsum.photos/512/512"
            },
            {
              "id": "width",
              "name": "width",
              "type": "number",
              "value": 1024
            },
            {
              "id": "height",
              "name": "height",
              "type": "number",
              "value": 1024
            },
            {
              "id": "prompt",
              "name": "prompt",
              "type": "string",
              "value": "An astronaut riding a rainbow unicorn"
            },
            {
              "id": "refine",
              "name": "refine",
              "type": "string",
              "value": "no_refiner"
            },
            {
              "id": "scheduler",
              "name": "scheduler",
              "type": "string",
              "value": "K_EULER"
            },
            {
              "id": "lora_scale",
              "name": "lora_scale",
              "type": "number",
              "value": 0.6
            },
            {
              "id": "num_outputs",
              "name": "num_outputs",
              "type": "number",
              "value": 1
            },
            {
              "id": "refine_steps",
              "name": "refine_steps",
              "type": "number",
              "value": 1
            },
            {
              "id": "guidance_scale",
              "name": "guidance_scale",
              "type": "number",
              "value": 7.5
            },
            {
              "id": "apply_watermark",
              "name": "apply_watermark",
              "type": "boolean",
              "value": true
            },
            {
              "id": "high_noise_frac",
              "name": "high_noise_frac",
              "type": "number",
              "value": 0.8
            },
            {
              "id": "negative_prompt",
              "name": "negative_prompt",
              "type": "string",
              "value": ""
            },
            {
              "id": "prompt_strength",
              "name": "prompt_strength",
              "type": "number",
              "value": 0.8
            },
            {
              "id": "replicate_weights",
              "name": "replicate_weights",
              "type": "string",
              "value": ""
            },
            {
              "id": "num_inference_steps",
              "name": "num_inference_steps",
              "type": "number",
              "value": 50
            },
            {
              "id": "disable_safety_checker",
              "name": "disable_safety_checker",
              "type": "boolean",
              "value": false
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "ad49e02a-5160-4f22-b800-2700f4887a01",
      "name": "Create Other Prediction",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -64,
        -128
      ],
      "parameters": {
        "url": "https://api.replicate.com/v1/predictions",
        "method": "POST",
        "options": {
          "response": {
            "response": {
              "neverError": true,
              "responseFormat": "json"
            }
          }
        },
        "jsonBody": "={\n  \"version\": \"babysea/babyavatar:f879b89acc5b931e4d180de5ef0e89782a4937cd4ae1d59be9a502a01a7b8c8c\",\n  \"input\": {\n    \"mask\": \"{{ $json.mask }}\",\n    \"seed\": {{ $json.seed }},\n    \"image\": \"{{ $json.image }}\",\n    \"width\": {{ $json.width }},\n    \"height\": {{ $json.height }},\n    \"prompt\": \"{{ $json.prompt }}\",\n    \"refine\": \"{{ $json.refine }}\",\n    \"scheduler\": \"{{ $json.scheduler }}\",\n    \"lora_scale\": {{ $json.lora_scale }},\n    \"num_outputs\": {{ $json.num_outputs }},\n    \"refine_steps\": {{ $json.refine_steps }},\n    \"guidance_scale\": {{ $json.guidance_scale }},\n    \"apply_watermark\": {{ $json.apply_watermark }},\n    \"high_noise_frac\": {{ $json.high_noise_frac }},\n    \"negative_prompt\": \"{{ $json.negative_prompt }}\",\n    \"prompt_strength\": {{ $json.prompt_strength }},\n    \"replicate_weights\": \"{{ $json.replicate_weights }}\",\n    \"num_inference_steps\": {{ $json.num_inference_steps }},\n    \"disable_safety_checker\": {{ $json.disable_safety_checker }}\n  }\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Bearer {{ $json.api_token }}"
            },
            {
              "name": "Prefer",
              "value": "wait"
            }
          ]
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "31b84d94-e1c3-4d74-b786-0f95e5f6923b",
      "name": "Wait 5s",
      "type": "n8n-nodes-base.wait",
      "position": [
        160,
        -128
      ],
      "parameters": {
        "unit": "seconds",
        "amount": 5
      },
      "typeVersion": 1
    },
    {
      "id": "577872c2-8005-47d3-bb9b-981d0c8f084e",
      "name": "Check Status",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        384,
        -128
      ],
      "parameters": {
        "url": "=https://api.replicate.com/v1/predictions/{{ $('Create Other Prediction').item.json.id }}",
        "options": {
          "response": {
            "response": {
              "neverError": true,
              "responseFormat": "json"
            }
          }
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Bearer {{ $('Set API Token').item.json.api_token }}"
            }
          ]
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "c46991c6-1dde-45c5-995c-cd94ec192e55",
      "name": "Is Complete?",
      "type": "n8n-nodes-base.if",
      "position": [
        528,
        -240
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "c93d7ba1-0ef9-4087-aa10-389cb2a2c6bd",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "succeeded"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "e46dde55-8bba-4554-8e38-9358c4b4a988",
      "name": "Has Failed?",
      "type": "n8n-nodes-base.if",
      "position": [
        848,
        -80
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "d1bfd044-3a07-4c18-b55f-72d192596139",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "failed"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "80e8ba16-902a-427c-a192-fa1c91f8f745",
      "name": "Wait 10s",
      "type": "n8n-nodes-base.wait",
      "position": [
        720,
        128
      ],
      "parameters": {
        "unit": "seconds",
        "amount": 10
      },
      "typeVersion": 1
    },
    {
      "id": "a01ec50b-db85-48f9-9a53-d6da2b9b32fa",
      "name": "Success Response",
      "type": "n8n-nodes-base.set",
      "position": [
        832,
        -320
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "success-response",
              "name": "response",
              "type": "object",
              "value": "={{ { success: true, result_url: $json.output, prediction_id: $json.id, status: $json.status, message: 'Other generated successfully' } }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "e8079b0b-abbe-414c-a782-6a6727a66419",
      "name": "Error Response",
      "type": "n8n-nodes-base.set",
      "position": [
        1344,
        144
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "error-response",
              "name": "response",
              "type": "object",
              "value": "={{ { success: false, error: $json.error || 'Other generation failed', prediction_id: $json.id, status: $json.status, message: 'Failed to generate other' } }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "c9f8d159-bc60-46f0-88fa-92d637f9e315",
      "name": "Display Result",
      "type": "n8n-nodes-base.set",
      "position": [
        1552,
        -144
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "final-result",
              "name": "final_result",
              "type": "object",
              "value": "={{ $json.response }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "a5869f4e-157b-439b-963a-fec4154b209d",
      "name": "Log Request",
      "type": "n8n-nodes-base.code",
      "position": [
        160,
        -320
      ],
      "parameters": {
        "jsCode": "// Log generation details for monitoring\nconst data = $input.all()[0].json;\n\nconsole.log('babysea/babyavatar Request:', {\n  timestamp: new Date().toISOString(),\n  prediction_id: data.id,\n  model_type: 'other'\n});\n\nreturn $input.all();"
      },
      "typeVersion": 2
    },
    {
      "id": "d528f5d0-aee7-4409-93a2-324f8ad39d2c",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1536,
        -304
      ],
      "parameters": {
        "color": 4,
        "width": 580,
        "height": 320,
        "content": "=======================================\n        BABYAVATAR GENERATOR\n=======================================\nFor any questions or support, please contact:\n    Yaron@nofluff.online\n\nExplore more tips and tutorials here:\n   - YouTube: https://www.youtube.com/@YaronBeen/videos\n   - LinkedIn: https://www.linkedin.com/in/yaronbeen/\n======================================="
      },
      "typeVersion": 1
    },
    {
      "id": "686213ee-bb4f-4fee-9507-8c541e5efc62",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1536,
        48
      ],
      "parameters": {
        "color": 4,
        "width": 589,
        "height": 1958,
        "content": "## \ud83e\udd16 **BABYSEA/BABYAVATAR - OTHER GENERATION WORKFLOW**\n\n**\ud83d\udd25 Powered by Replicate API and n8n Automation**\n\n---\n\n### \ud83d\udcdd **Model Overview**\n\n- **Owner**: babysea\n- **Model**: babyavatar\n- **Type**: Other Generation\n- **API Endpoint**: https://api.replicate.com/v1/predictions\n\n**\ud83c\udfaf What This Model Does:**\nBabyAvatar - Create Stunning AI Avatars in Seconds\n\n---\n\n### \ud83d\udccb **Parameter Reference**\n\n**\ud83d\udd34 Required Parameters:** None\n**\ud83d\udd35 Optional Parameters:** mask, seed, image, width, height, prompt, refine, scheduler (and 11 more)\n\n**\ud83d\udcd6 Detailed Parameter Guide:**\n- **mask** (string): Input mask for inpaint mode. Black areas will be preserved, white areas will be inpainted.\n- **seed** (integer): Random seed. Leave blank to randomize the seed\n- **image** (string): Input image for img2img or inpaint mode\n- **width** (integer): Width of output image (Default: 1024)\n- **height** (integer): Height of output image (Default: 1024)\n- **prompt** (string): Input prompt (Default: An astronaut riding a rainbow unicorn)\n- **refine** (string): Which refine style to use (Default: no_refiner)\n- **scheduler** (string): scheduler (Default: K_EULER)\n- *...and 11 more parameters*\n\n---\n\n### \ud83d\udd27 **Workflow Components Explained**\n\n**\ud83c\udfaf Manual Trigger**\n- Starts the workflow execution\n- Click to begin other generation process\n\n**\ud83d\udd10 Set API Token** \n- Configures your Replicate API authentication\n- Replace 'YOUR_REPLICATE_API_TOKEN' with your actual token\n- Essential for accessing the babysea/babyavatar model\n\n**\u2699\ufe0f Set Other Parameters**\n- Configures all input parameters for the model\n- Includes both required and optional parameters\n- Pre-filled with sensible defaults for testing\n\n**\ud83d\ude80 Create Other Prediction**\n- Sends the generation request to Replicate API\n- Uses the other parameters you configured\n- Returns a prediction ID for status tracking\n\n**\u23f3 Wait & Status Checking Loop**\n- Waits 5 seconds then checks prediction status\n- Continues checking until completion or failure\n- Implements intelligent retry logic with 10-second delays\n\n**\u2705 Success/Error Handling**\n- Routes successful completions to success response\n- Handles failures gracefully with error details\n- Returns structured JSON response with URLs/errors\n\n**\ud83d\udcca Logging & Monitoring**\n- Logs all requests for debugging and monitoring\n- Tracks timestamps and prediction IDs\n- Helps identify issues during development\n\n---\n\n### \ud83c\udf1f **Key Benefits**\n\n- **\ud83c\udfa8 Instant Other Generation**: Transform ideas into others using state-of-the-art AI\n- **\ud83d\udd04 Automated Workflow**: Handles the complete generation pipeline automatically\n- **\ud83d\udee1\ufe0f Error Resilience**: Built-in retry logic and comprehensive error handling\n- **\ud83d\udcc8 Production Ready**: Includes logging, monitoring, and structured responses\n- **\ud83d\udd27 Customizable**: Easy to modify parameters and extend functionality\n- **\u26a1 Efficient Processing**: Optimized API calls with intelligent status checking\n\n---\n\n### \ud83d\ude80 **Quick Start Instructions**\n\n1. **\ud83d\udd11 Get Your API Key**\n   - Sign up at https://replicate.com\n   - Navigate to your account settings\n   - Copy your API token\n\n2. **\ud83d\udd27 Configure the Workflow**\n   - Replace 'YOUR_REPLICATE_API_TOKEN' with your actual token\n   - Adjust parameters in the 'Set Other Parameters' node\n   - Customize the prompt or other inputs as needed\n\n3. **\u25b6\ufe0f Execute the Workflow**\n   - Click the 'Manual Trigger' to start\n   - Monitor the execution in the n8n interface\n   - Check logs for detailed execution information\n\n4. **\ud83d\udce5 Get Your Results**\n   - Successful generations return a URL to your other\n   - Download or use the generated content as needed\n   - Results are available immediately upon completion\n\n---\n\n### \ud83d\udd0d **Troubleshooting Guide**\n\n**Common Issues:**\n- **Invalid API Token**: Ensure your Replicate token is valid and has sufficient credits\n- **Parameter Validation**: Check that required parameters match expected types\n- **Generation Timeout**: Some others take longer - monitor the logs\n- **Output Format**: Verify the model returns the expected output format\n\n**Best Practices:**\n- Test with default parameters first\n- Monitor your Replicate usage and billing\n- Keep API tokens secure and never commit them to code\n- Use appropriate parameter values for your use case\n\n---\n\n**\ud83d\udd17 Additional Resources:**\n- Model Documentation: https://replicate.com/babysea/babyavatar\n- Replicate API Docs: https://replicate.com/docs\n- n8n Documentation: https://docs.n8n.io\n\n---"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "versionId": "1",
  "connections": {
    "Wait 5s": {
      "main": [
        [
          {
            "node": "Check Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 10s": {
      "main": [
        [
          {
            "node": "Check Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has Failed?": {
      "main": [
        [
          {
            "node": "Error Response",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait 10s",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Request": {
      "main": [
        [
          {
            "node": "Wait 5s",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Status": {
      "main": [
        [
          {
            "node": "Is Complete?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Complete?": {
      "main": [
        [
          {
            "node": "Success Response",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Has Failed?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set API Token": {
      "main": [
        [
          {
            "node": "Set Other Parameters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Error Response": {
      "main": [
        [
          {
            "node": "Display Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Set API Token",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Success Response": {
      "main": [
        [
          {
            "node": "Display Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Other Parameters": {
      "main": [
        [
          {
            "node": "Create Other Prediction",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Other Prediction": {
      "main": [
        [
          {
            "node": "Log Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}