ChatGPTCreativeDesignAI score · PendingAI-assisted edit · no obvious prompt-injection riskn8n.io

Build Consistent AI Character Images with n8n + Google Nano Banana + Kie.ai Upscaling

Manual trigger → create timestamped Google Drive folder and tracking sheet → GPT-4 generates scene prompt → Kie.ai NanoBanana creates image → poll status → 4× upscale with face enhancement → archive to Drive and update Sheets

Some experienceStepsWorkflowPromptTip
Who
Content creators and automation engineers who need consistent character visuals for social media or marketing
You get
One-click generation of style-consistent AI character images with automatic 4× upscaling, timestamped Google Drive archiving, and progress logged in Google Sheets
You need
n8n · google-drive · google-sheets

Constraints

Prerequisites: n8n instance; Kie.ai account and API token; OpenAI API key; Google Drive and Google Sheets OAuth2 credentials. Costs: Kie.ai per-call, OpenAI per-token, Google services usually within free tier. Note: the template hardcodes a Google Drive folder ID and 5 reference image URLs — replace these with your own before use.

What they did

Author mfarooqone published template #8492 on n8n.io, demonstrating how to combine OpenAI GPT-4 (gpt-4.1-mini) with Kie.ai's google/nano-banana-edit and nano-banana-upscale models into an end-to-end AI character image generation and enhancement workflow. The workflow contains 33 nodes across 7 stages: project initialization, story/prompt generation, image generation, status polling, 4× upscale enhancement, file archiving, and progress tracking. The core mechanism uses 5 reference images to constrain the NanoBanana model for character consistency, plus a structured output parser to ensure prompt format control.

How it went

The author reports 500+ downloads (author_report). The template status on n8n.io is published. This site has not imported or executed the workflow; Kie.ai call success rates, image quality, and upscale results are unverified.

Worth knowing

1. Hardcoded parameters must be replaced: the Google Drive folder ID (1GND1exvlAXTzESNvWmFs6FFMx90KLzlC) and 5 i.ibb.co reference image URLs are the author's example values; failure to replace will cause errors or unrelated image generation. 2. Model selection: the saved node value is gpt-4.1-mini, but the OpenAI Chat Model node supports switching to gpt-4.1 or gpt-4; costs and latency will vary. 3. Async polling without callback: Kie.ai tasks use polling (Wait + Poll Task + Switch) rather than webhook callbacks, suitable for n8n instances without public URLs but increasing total execution time. 4. Face enhancement only at upscaling: face_enhance: true applies only to nano-banana-upscale, not to the initial generation. 5. Code node dependency: Code1 performs multi-layer escape cleaning; if Kie.ai or OpenAI response formats change, parsing logic may need adjustment. 6. Credential types required: googleDriveOAuth2Api, googleSheetsOAuth2Api, and openAiApi, all configured in n8n's credential manager.

n8n workflow template

Structure checked · Not run-tested

Use “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.

Setup and test checklist

Credentials to connect

  • Create folder node: connect Google Drive OAuth2 credentials.
  • Add Fields node: connect Google Sheets OAuth2 credentials.
  • Create spreadsheet node: connect Google Sheets OAuth2 credentials.
  • Move Sheet node: connect Google Drive OAuth2 credentials.
  • Update Image Status node: connect Google Sheets OAuth2 credentials.
  • Story Status Update node: connect Google Sheets OAuth2 credentials.
  • OpenAI Chat Model3 node: connect OpenAI API credentials.
  • Upload file node: connect Google Drive OAuth2 credentials.
  • Move Images node: connect Google Drive OAuth2 credentials.
  • Replace __UKH_BEARER_0__ with your real secret/token (path /nodes/0/parameters/headerParameters/parameters/0/value; literal auth header).
  • Replace __UKH_BEARER_2__ with your real secret/token (path /nodes/2/parameters/headerParameters/parameters/0/value; literal auth header).
  • Replace __UKH_BEARER_21__ with your real secret/token (path /nodes/21/parameters/headerParameters/parameters/0/value; literal auth header).
  • Replace __UKH_BEARER_25__ with your real secret/token (path /nodes/25/parameters/headerParameters/parameters/0/value; literal auth header).

Configuration to replace

  • Source template is n8n public workflow #8492 (~33 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
  • Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.

Test input and expected output

  • Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
  • Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.

Template changes

  • Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
  • No business-logic edits; verify keys, quotas and privacy compliance before use. 4 literal secret value(s) replaced with __UKH_…__ placeholders.

Template retrieved: 2026-10-24

Steps

  1. Project setup: create folder and tracking sheet

    After importing the template into n8n, verify credential configuration. The workflow starts with a manual trigger node (When clicking 'Execute workflow'). The Folder Name node uses JavaScript to generate a timestamped folder name (format: Post HH:MM AM/PM DD Month YYYY). Then Create folder creates that folder under a specified Google Drive parent; Create spreadsheet creates a Google Sheet with the same name; Move Sheet moves the sheet into the new folder; Edit Fields initializes Prompt, Temp Image Url, and Status fields; Add Fields appends the first row to the sheet.

  2. Generate scene prompt

    The Story Creator Agent node is a Basic LLM Chain connected to an OpenAI Chat Model (default gpt-4.1-mini) and a Structured Output Parser. The system message defines a unified character portrait style template: 'A highly realistic modern cinematic portrait of the same girl, always facing the camera...' with Styling Keywords (Photorealism, cinematic photography, etc.). The LLM generates a scene-specific prompt based on this template, constrained by Json parser4 to the format {"prompt": "..."}. The Code1 node cleans escapes and normalizes whitespace to extract plain text. Story Status Update writes the generated prompt and status 'prompt created' back to Google Sheets row 2.

    Execution prompt · Source text。Story Creator Agent node messages.messageValues[0].message field; serves as LLM Chain system/style instruction

    A highly realistic modern cinematic portrait of the same girl, always facing the camera with a natural, expressive look. She is in [location/setting] wearing [modern, stylish outfit/clothing style], engaged in [action/mood]. Lighting and atmosphere are contemporary and cinematic, matching the environment with sleek tones and realistic detail. Ultra-detailed skin, expressive eyes, lifelike textures, cinematic depth of field, modern color grading, immersive realism.
    
    Styling Keywords (keep for all scenes):
    
    Photorealism, cinematic photography, modern fashion styling, expressive emotion, natural face, immersive lighting, dynamic depth, editorial aesthetic, storytelling tone.
  3. Call Kie.ai to generate image

    The Create Task (no callback) node sends a POST request to https://api.kie.ai/api/v1/jobs/createTask. The body sets model to 'google/nano-banana-edit', with input containing the previous step's prompt and an array of 5 reference image URLs (image_urls), output_format: 'png', and image_size: 'auto'. The header must include Authorization: Bearer YOUR_TOKEN_HERE. Then Set TaskId extracts data.taskId from the response for later polling.

    Execution prompt · Source text。Create Task (no callback) node jsonBody field; replace image_urls with actual reference images

    ={
      "model": "google/nano-banana-edit",
      "input": {
        "prompt": "{{ $json.Prompt }}",
        "image_urls": [
                  "https://i.ibb.co/q332LXHf/Whats-App-Image-2025-09-11-at-15-54-09.jpg",
                  "https://i.ibb.co/rPRzBdK/Whats-App-Image-2025-09-11-at-15-54-11-1.jpg",
                  "https://i.ibb.co/Zz9HPfZ9/Whats-App-Image-2025-09-11-at-15-54-12-1.jpg",
                  "https://i.ibb.co/tp7rhyK7/Whats-App-Image-2025-09-11-at-15-54-12-2.jpg",
                  "https://i.ibb.co/N2wDdJpJ/Whats-App-Image-2025-09-11-at-15-54-12-3.jpg"
        ],
        "output_format": "png",
        "image_size": "auto"
      }
    }
  4. Poll task status and extract results

    The Wait 1 Min node waits one minute, then Poll Task sends a GET request to https://api.kie.ai/api/v1/jobs/recordInfo with query parameter taskId from Set TaskId. The Switch node branches based on data.state and data.resultJson: if state='fail' → fail branch; if resultJson is empty → return to Wait 1 Min; if resultJson is non-empty → success branch. On success, Get ResultUrls uses JavaScript to parse resultJson and extract the resultUrls array.

    Execution prompt · Source text。Get ResultUrls node jsCode field; extracts image URLs from polling response

    // n8n Function node
    const items = $input.all();
    const out = [];
    
    for (const item of items) {
      // Your HTTP node sometimes returns an array at top-level
      const payload = item.json;
      const first = Array.isArray(payload) ? payload[0] : payload;
    
      // Get the stringified resultJson safely
      const resultJsonStr = first?.data?.resultJson ?? '';
    
      // Parse and extract
      let resultUrls = [];
      try {
        const parsed = JSON.parse(resultJsonStr);
        resultUrls = parsed?.resultUrls ?? [];
      } catch (e) {
        // leave resultUrls as []
      }
    
      out.push({ json: { resultUrls } });
    }
    
    return out;
  5. 4× upscale with face enhancement

    The resultUrls[0] from Get ResultUrls feeds into the Upscale Image node. This node POSTs to https://api.kie.ai/api/v1/jobs/createTask with model set to 'nano-banana-upscale', input containing image: resultUrls[0], scale: 4, and face_enhance: true. Then Set TaskId for upscale extracts the new taskId, Wait 1 Min1 waits, Get Upscaled Image polls, Switch1 evaluates state, and Get ResultUrls from UpScale parses the final result URL.

    Execution prompt · Source text。Upscale Image node jsonBody field

    ={
      "model": "nano-banana-upscale",
      "input": {
        "image": "{{ $json.resultUrls[0] }}",
        "scale": 4,
        "face_enhance": true
      }
    }

    Execution prompt · Source text。Get ResultUrls from UpScale node jsCode field

    // Build a new array of JSON objects with only resultUrls
    return $input.all().map(item => {
      const result = JSON.parse(item.json.data.resultJson);
      return {
        resultUrls: result.resultUrls
      };
    });
  6. Archive to Google Drive

    The Get Binary node downloads the image binary using resultUrls as the URL. Upload file uploads the file to Google Drive (defaulting to a hardcoded 'prompt' folder, with filename set to the upscale taskId). Move Images moves the uploaded file into the timestamped folder created in step 1.

  7. Update tracking sheet status

    The Update Image Status node updates Google Sheets row 2, setting Status to 'image created' and Temp Image Url to resultUrls[0] from Get Binary. The workflow is now complete; view the final image in the Google Drive timestamped folder and the full status history in Sheets.

Prompt you can copy

Setup guidance · Editorial suggestion。Hand to setup assistant to confirm inputs and permissions before replacing hardcoded parameters

This block is the prompt. Ads are never placed here.

You are reproducing an n8n workflow template that uses Kie.ai's NanoBanana model to generate consistent character images and automatically upscale them 4×. First confirm you have: Kie.ai API Token, OpenAI API Key, Google Drive OAuth2, and Google Sheets OAuth2 credentials. Then import the template, replace the hardcoded Google Drive folder ID and 5 reference image URLs, and execute the manual trigger.

Replace YOUR_TOKEN_HERE, folder ID, and reference image URLs before running

Source

Create consistent AI characters with Google Nano Banana & upscaling via Kie.ai · mfarooqone · n8n.io · 2025-09-12

Comments & feedback

Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.

Loading…

    Related