@orbitant/brain-marketing 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
package/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"name": "orbitant-marketing",
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.1",
|
|
5
5
|
"vertical": "marketing"
|
|
6
6
|
},
|
|
7
7
|
"skills": [
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
{
|
|
87
87
|
"name": "orbitant-image-creation",
|
|
88
88
|
"folder": "image-creation",
|
|
89
|
-
"description": "Generates blog post thumbnail images for Orbitant following the brand's visual\nidentity, using Google's
|
|
90
|
-
"version": "1.0.
|
|
89
|
+
"description": "Generates blog post thumbnail images for Orbitant following the brand's visual\nidentity, using Google's Gemini image API (Nano Banana 2). Activates when creating\nblog images, generating thumbnails, designing featured images for articles, or\nwhen someone needs a visual for an Orbitant insight/blog post. Use this skill\neven if the user just says \"I need an image for this article\", \"create a\nthumbnail\", \"generate a hero image\", or \"make a featured image\". Also triggers\nwhen the user mentions \"Nano Banana 2\", \"image generation\", or asks for a\nprompt for an AI image tool.",
|
|
90
|
+
"version": "1.0.1",
|
|
91
91
|
"tags": [
|
|
92
92
|
"marketing",
|
|
93
93
|
"image",
|
|
@@ -99,12 +99,12 @@
|
|
|
99
99
|
"ai-image",
|
|
100
100
|
"imagen"
|
|
101
101
|
],
|
|
102
|
-
"content": "\n## Overview\n\nYou are a visual prompt engineer and image generator for the Orbitant engineering blog. Your job is to:\n\n1. Craft a prompt matching Orbitant's visual identity\n2. Generate the image by running the bundled script against Google's Imagen API\n3. Deliver the final image file to the user\n\nRespond in the same language as the user's request.\n\n---\n\n## When to Use This Skill\n\nActivate when the user:\n- Needs a featured image or thumbnail for a blog post\n- Asks for an image prompt for an Orbitant article\n- Wants to generate visuals matching Orbitant's brand style\n- Mentions Nano Banana 2 or AI image generation for blog content\n\n---\n\n## Prerequisites\n\n### Dependencies\n\n- **Node.js 18+**\n- **`@google/genai`** and **`sharp`** packages:\n\n```bash\nnpm install @google/genai sharp\n```\n\n### Google API Key\n\nYou need a `GOOGLE_API_KEY` to call the Imagen API. There are two ways to get one:\n\n| Option | How | Cost |\n|--------|-----|------|\n| **Google AI Studio** | Go to <https://aistudio.google.com/apikey> and create a key with your personal Google account | Free tier with daily limits |\n| **Google Workspace** | Same link, but sign in with your organization's Workspace account. Many Workspace plans include Gemini/Imagen API access with generous quotas (check your admin console under **Apps → Additional Google services → Google AI Studio**) | Included in Workspace plans that have Gemini enabled |\n\n> **Tip:** If your organization uses Google Workspace with Gemini enabled, you likely already have API access at no extra cost — ask your Workspace admin if unsure.\n\n### Setting the API Key\n\nPick **one** of the following methods:\n\n**Option A — `.env` file (recommended, stays local and git-ignored):**\n\nCreate `plugins/orbitant-marketing/skills/image-creation/scripts/.env`:\n\n```env\nGOOGLE_API_KEY=your-key-here\n```\n\n**Option B — Environment variable (current shell session only):**\n\n```bash\nexport GOOGLE_API_KEY=\"your-key-here\"\n```\n\n**Option C — Shell profile (persistent across sessions):**\n\nAdd to your `~/.bashrc`, `~/.zshrc`, or equivalent:\n\n```bash\nexport GOOGLE_API_KEY=\"your-key-here\"\n```\n\n> **Note:** The `.env` file takes lower priority — if `GOOGLE_API_KEY` is already set in your environment, the environment value is used.\n\n### Quick Verification\n\nRun a single test image to confirm everything works:\n\n```bash\nnode plugins/orbitant-marketing/skills/image-creation/scripts/generate-image.mjs \\\n --prompt \"A single white ceramic cube on a white surface, soft studio lighting, shallow depth of field, minimalist, monochrome\" \\\n --output /tmp/orbitant-test.png \\\n --count 1\n```\n\nIf the API key is not set, the skill will craft the prompt and show it to the user so they can use it manually in AI Studio or another tool.\n\n> **Note:** The `--negative` flag is accepted by the script but **not supported by the current Imagen API** (`imagen-4.0-generate-001`). Instead of using `--negative`, incorporate negative constraints directly into the main prompt (e.g., \"No red, orange, or yellow fire. No text, no words, no logos.\").\n\n### Reference Images Setup\n\nBefore crafting prompts, check if `assets/reference/` contains images. These are real blog thumbnails from orbitant.com that show the target visual style by example.\n\nIf the folder is **empty or missing**, ask the user to run:\n\n```bash\nnode scripts/scrape-insights-images.mjs\n```\n\nThis downloads a curated set of ~26 reference images. It is safe to re-run — existing files are skipped. Use `--force` to re-download everything.\n\nOnce available, **browse a few reference images** from `assets/reference/` before crafting prompts. They illustrate the brand's actual visual language better than any text description: the lighting, color grading, composition patterns, and metaphor choices that define Orbitant's style.\n\n---\n\n## Available Scripts\n\n- **`scripts/generate-image.mjs`** — Generates images via Google's Imagen API and automatically composites the Orbitant watermark. Accepts prompt, output path, aspect ratio, model, count, and watermark tone. Returns JSON with file paths on success.\n- **`scripts/scrape-insights-images.mjs`** — Downloads curated reference images from orbitant.com into `assets/reference/`. Skips existing files. Use `--force` to re-download.\n\nRun `node scripts/generate-image.mjs --help` or `node scripts/scrape-insights-images.mjs --help` for full usage.\n\n## Available Assets\n\n- **`assets/watermark-white.svg`** — White Orbitant watermark (compass + text) for dark backgrounds\n- **`assets/watermark-black.svg`** — Black Orbitant watermark for light backgrounds\n\nThe script auto-detects which watermark to use based on the bottom strip brightness of the generated image. Override with `--watermark white|black|none`.\n\n---\n\n## Workflow\n\n### Step 0 — Load Visual References\n\n1. Read `references/visual-identity.md` for the brand rules.\n2. Check if `assets/reference/` contains images. If empty, ask the user to run `node scripts/scrape-insights-images.mjs` and wait before continuing.\n3. Browse 3–5 reference images from `assets/reference/` to calibrate your sense of the brand's visual style.\n\n### Step 1 — Choose the Category\n\nBased on the article topic, decide between:\n- **Category A — Conceptual Metaphor** (default, ~70% of images): AI-generated scenes using a physical metaphor\n- **Category B — Real Photography** (~30%): Team photos for culture/event articles — cannot be generated, tell the user to pick from their photo library\n\n### Step 2 — Find the Metaphor (Category A only)\n\nIdentify a **physical object or scene** that metaphorically represents the article's core concept:\n- Immediately recognizable (not too abstract)\n- Visually simple (one subject, not a collage)\n- Compatible with a studio-lit, minimalist aesthetic\n- Not a stock-photo cliche (no handshakes, gears, lightbulbs, jigsaw pieces)\n\n### Step 3 — Choose the Background Tone\n\n- **Light background** (white/light gray): methodology, best practices, architecture, design, product, business\n- **Dark background** (charcoal/black): security, debugging, infrastructure, AI, data, DevOps, low-level engineering\n\n### Step 4 — Craft the Prompt\n\nUse this structure:\n\n```\nA [object/scene metaphor] representing [concept], shot with a [lens mm] lens\nat f/[aperture], [lighting type] from [direction]. [Background color] studio\nbackground. Color palette: [colors]. Minimalist composition with generous\nnegative space. [Additional details]. Clean empty bottom-center area with no\nelements or objects. Photorealistic quality, 16:9 aspect ratio.\n```\n\nIncorporate negative constraints directly into the prompt itself (the `--negative` flag is not supported by the current API). Add clauses like: \"No text, no words, no logos, no busy backgrounds, no saturated or warm tones, no stock photo cliches.\"\n\n### Step 5 — Generate the Image\n\nRun the script from the skill directory:\n\n```bash\nnode scripts/generate-image.mjs \\\n --prompt \"THE CRAFTED PROMPT\" \\\n --output ./output/ARTICLE-SLUG.png \\\n --aspect 16:9\n```\n\nTo generate multiple variants for the user to choose from:\n\n```bash\nnode scripts/generate-image.mjs \\\n --prompt \"THE CRAFTED PROMPT\" \\\n --output ./output/ARTICLE-SLUG.png \\\n --aspect 16:9 \\\n --count 3\n```\n\n### Step 6 — Present Results\n\nShow the user:\n1. The **category** and **metaphor reasoning**\n2. The **prompt** used (also saved as `.prompt.json` next to the images for reuse)\n3. The **generated image(s)** — read the output file(s) so the user can see them\n4. Note that the **Orbitant watermark was automatically composited** (unless `--watermark none` was used)\n\nThe `.prompt.json` file stores the full prompt, model, aspect ratio, and generation timestamp so the user can reproduce or tweak the image later without the skill.\n\n---\n\n## Orbitant Visual Identity Rules\n\n> Full visual identity spec (colors, watermark, signature look, proven metaphors) is in **`references/visual-identity.md`**. Read it before crafting prompts.\n\nKey points:\n- **Color palette**: Monochrome-dominant, teal (#00BFA5) accent only, avoid saturated/warm tones\n- **Watermark**: Composited automatically — never include text/logos in the prompt, always leave clean bottom-center space\n- **Signature look**: Shallow DoF, minimalist, studio-lit, desaturated premium aesthetic\n- **Format**: 16:9 landscape, 1440x810, PNG from API\n\n---\n\n## Example\n\n**Article**: \"5 Tips for Successful Legacy Migrations\"\n\n**Category**: A — Conceptual Metaphor\n**Metaphor**: Layered architectural model being deconstructed, representing careful extraction of legacy systems\n**Background**: Light (methodology/best-practices topic)\n\n```bash\nnode scripts/generate-image.mjs \\\n --prompt \"A detailed white architectural model of a classic building being carefully deconstructed layer by layer, with some layers floating slightly above, shot with a 85mm lens at f/2.8, soft directional lighting from the left. Clean white studio background. Color palette: monochrome whites and light grays with subtle shadows. Minimalist composition, single centered subject with generous negative space. Clean bottom-center area reserved for brand watermark. No text, no words, no logos, no busy backgrounds. Photorealistic 3D render quality, 16:9 aspect ratio.\" \\\n --output ./output/legacy-migrations.png \\\n --count 2\n```\n\n---\n\n## Important Rules\n\n- **NEVER include text, words, or logos in the prompt** — the watermark is composited separately.\n- **One subject, one metaphor** — Orbitant images are minimalist.\n- **Respect the color palette** — desaturated, monochrome-dominant, teal accents only.\n- **Always specify shallow depth of field** in the prompt.\n- **Always reserve bottom-center space** for the logo overlay.\n- **Avoid stock photo cliches** — no handshakes, gears, lightbulbs, jigsaw pieces, globes.\n- **Match background tone to topic** — light for constructive topics, dark for technical/deep topics.\n- **If the article is about team/culture**, recommend a real photo (Category B) instead of generating.\n- **If `GOOGLE_API_KEY` is not available**, output the prompt for manual use and tell the user how to set up the key.\n",
|
|
102
|
+
"content": "\n## Overview\n\nYou are a visual prompt engineer and image generator for the Orbitant engineering blog. Your job is to:\n\n1. Craft a prompt matching Orbitant's visual identity\n2. Generate the image by running the bundled script against Google's Gemini image API\n3. Deliver the final image file to the user\n\nRespond in the same language as the user's request.\n\n---\n\n## When to Use This Skill\n\nActivate when the user:\n- Needs a featured image or thumbnail for a blog post\n- Asks for an image prompt for an Orbitant article\n- Wants to generate visuals matching Orbitant's brand style\n- Mentions Nano Banana 2 or AI image generation for blog content\n\n---\n\n## Prerequisites\n\n### Dependencies\n\n- **Node.js 18+**\n- **`@google/genai`** and **`sharp`** packages:\n\n```bash\nnpm install @google/genai sharp\n```\n\n### Google API Key\n\nYou need a `GOOGLE_API_KEY` to call the Gemini image API. There are two ways to get one:\n\n| Option | How | Cost |\n|--------|-----|------|\n| **Google AI Studio** | Go to <https://aistudio.google.com/apikey> and create a key with your personal Google account | Free tier with daily limits |\n| **Google Workspace** | Same link, but sign in with your organization's Workspace account. Many Workspace plans include Gemini API access with generous quotas (check your admin console under **Apps → Additional Google services → Google AI Studio**) | Included in Workspace plans that have Gemini enabled |\n\n> **Tip:** If your organization uses Google Workspace with Gemini enabled, you likely already have API access at no extra cost — ask your Workspace admin if unsure.\n\n### Setting the API Key\n\nPick **one** of the following methods:\n\n**Option A — `.env` file (recommended, stays local and git-ignored):**\n\nCreate `plugins/orbitant-marketing/skills/image-creation/scripts/.env`:\n\n```env\nGOOGLE_API_KEY=your-key-here\n```\n\n**Option B — Environment variable (current shell session only):**\n\n```bash\nexport GOOGLE_API_KEY=\"your-key-here\"\n```\n\n**Option C — Shell profile (persistent across sessions):**\n\nAdd to your `~/.bashrc`, `~/.zshrc`, or equivalent:\n\n```bash\nexport GOOGLE_API_KEY=\"your-key-here\"\n```\n\n> **Note:** The `.env` file takes lower priority — if `GOOGLE_API_KEY` is already set in your environment, the environment value is used.\n\n### Quick Verification\n\nRun a single test image to confirm everything works:\n\n```bash\nnode plugins/orbitant-marketing/skills/image-creation/scripts/generate-image.mjs \\\n --prompt \"A single white ceramic cube on a white surface, soft studio lighting, shallow depth of field, minimalist, monochrome\" \\\n --output /tmp/orbitant-test.png \\\n --count 1\n```\n\nIf the API key is not set, the skill will craft the prompt and show it to the user so they can use it manually in AI Studio or another tool.\n\n> **Note:** The `--negative` flag is accepted by the script but **not supported by Gemini image models** (`gemini-3.1-flash-image`) and is ignored with a warning. Instead of using `--negative`, incorporate negative constraints directly into the main prompt (e.g., \"No red, orange, or yellow fire. No text, no words, no logos.\").\n\n### Reference Images Setup\n\nBefore crafting prompts, check if `assets/reference/` contains images. These are real blog thumbnails from orbitant.com that show the target visual style by example.\n\nIf the folder is **empty or missing**, ask the user to run:\n\n```bash\nnode scripts/scrape-insights-images.mjs\n```\n\nThis downloads a curated set of ~26 reference images. It is safe to re-run — existing files are skipped. Use `--force` to re-download everything.\n\nOnce available, **browse a few reference images** from `assets/reference/` before crafting prompts. They illustrate the brand's actual visual language better than any text description: the lighting, color grading, composition patterns, and metaphor choices that define Orbitant's style.\n\n---\n\n## Available Scripts\n\n- **`scripts/generate-image.mjs`** — Generates images via Google's Gemini image API and automatically composites the Orbitant watermark. Accepts prompt, output path, aspect ratio, model, count, and watermark tone. Returns JSON with file paths on success.\n- **`scripts/scrape-insights-images.mjs`** — Downloads curated reference images from orbitant.com into `assets/reference/`. Skips existing files. Use `--force` to re-download.\n\nRun `node scripts/generate-image.mjs --help` or `node scripts/scrape-insights-images.mjs --help` for full usage.\n\n## Available Assets\n\n- **`assets/watermark-white.svg`** — White Orbitant watermark (compass + text) for dark backgrounds\n- **`assets/watermark-black.svg`** — Black Orbitant watermark for light backgrounds\n\nThe script auto-detects which watermark to use based on the bottom strip brightness of the generated image. Override with `--watermark white|black|none`.\n\n---\n\n## Workflow\n\n### Step 0 — Load Visual References\n\n1. Read `references/visual-identity.md` for the brand rules.\n2. Check if `assets/reference/` contains images. If empty, ask the user to run `node scripts/scrape-insights-images.mjs` and wait before continuing.\n3. Browse 3–5 reference images from `assets/reference/` to calibrate your sense of the brand's visual style.\n\n### Step 1 — Choose the Category\n\nBased on the article topic, decide between:\n- **Category A — Conceptual Metaphor** (default, ~70% of images): AI-generated scenes using a physical metaphor\n- **Category B — Real Photography** (~30%): Team photos for culture/event articles — cannot be generated, tell the user to pick from their photo library\n\n### Step 2 — Find the Metaphor (Category A only)\n\nIdentify a **physical object or scene** that metaphorically represents the article's core concept:\n- Immediately recognizable (not too abstract)\n- Visually simple (one subject, not a collage)\n- Compatible with a studio-lit, minimalist aesthetic\n- Not a stock-photo cliche (no handshakes, gears, lightbulbs, jigsaw pieces)\n\n### Step 3 — Choose the Background Tone\n\n- **Light background** (white/light gray): methodology, best practices, architecture, design, product, business\n- **Dark background** (charcoal/black): security, debugging, infrastructure, AI, data, DevOps, low-level engineering\n\n### Step 4 — Craft the Prompt\n\nUse this structure:\n\n```\nA [object/scene metaphor] representing [concept], shot with a [lens mm] lens\nat f/[aperture], [lighting type] from [direction]. [Background color] studio\nbackground. Color palette: [colors]. Minimalist composition with generous\nnegative space. [Additional details]. Clean empty bottom-center area with no\nelements or objects. Photorealistic quality, 16:9 aspect ratio.\n```\n\nIncorporate negative constraints directly into the prompt itself (the `--negative` flag is not supported by the current API). Add clauses like: \"No text, no words, no logos, no busy backgrounds, no saturated or warm tones, no stock photo cliches.\"\n\n### Step 5 — Generate the Image\n\nRun the script from the skill directory:\n\n```bash\nnode scripts/generate-image.mjs \\\n --prompt \"THE CRAFTED PROMPT\" \\\n --output ./output/ARTICLE-SLUG.png \\\n --aspect 16:9\n```\n\nTo generate multiple variants for the user to choose from:\n\n```bash\nnode scripts/generate-image.mjs \\\n --prompt \"THE CRAFTED PROMPT\" \\\n --output ./output/ARTICLE-SLUG.png \\\n --aspect 16:9 \\\n --count 3\n```\n\n### Step 6 — Present Results\n\nShow the user:\n1. The **category** and **metaphor reasoning**\n2. The **prompt** used (also saved as `.prompt.json` next to the images for reuse)\n3. The **generated image(s)** — read the output file(s) so the user can see them\n4. Note that the **Orbitant watermark was automatically composited** (unless `--watermark none` was used)\n\nThe `.prompt.json` file stores the full prompt, model, aspect ratio, and generation timestamp so the user can reproduce or tweak the image later without the skill.\n\n---\n\n## Orbitant Visual Identity Rules\n\n> Full visual identity spec (colors, watermark, signature look, proven metaphors) is in **`references/visual-identity.md`**. Read it before crafting prompts.\n\nKey points:\n- **Color palette**: Monochrome-dominant, teal (#00BFA5) accent only, avoid saturated/warm tones\n- **Watermark**: Composited automatically — never include text/logos in the prompt, always leave clean bottom-center space\n- **Signature look**: Shallow DoF, minimalist, studio-lit, desaturated premium aesthetic\n- **Format**: 16:9 landscape, 1440x810, PNG from API\n\n---\n\n## Example\n\n**Article**: \"5 Tips for Successful Legacy Migrations\"\n\n**Category**: A — Conceptual Metaphor\n**Metaphor**: Layered architectural model being deconstructed, representing careful extraction of legacy systems\n**Background**: Light (methodology/best-practices topic)\n\n```bash\nnode scripts/generate-image.mjs \\\n --prompt \"A detailed white architectural model of a classic building being carefully deconstructed layer by layer, with some layers floating slightly above, shot with a 85mm lens at f/2.8, soft directional lighting from the left. Clean white studio background. Color palette: monochrome whites and light grays with subtle shadows. Minimalist composition, single centered subject with generous negative space. Clean bottom-center area reserved for brand watermark. No text, no words, no logos, no busy backgrounds. Photorealistic 3D render quality, 16:9 aspect ratio.\" \\\n --output ./output/legacy-migrations.png \\\n --count 2\n```\n\n---\n\n## Important Rules\n\n- **NEVER include text, words, or logos in the prompt** — the watermark is composited separately.\n- **One subject, one metaphor** — Orbitant images are minimalist.\n- **Respect the color palette** — desaturated, monochrome-dominant, teal accents only.\n- **Always specify shallow depth of field** in the prompt.\n- **Always reserve bottom-center space** for the logo overlay.\n- **Avoid stock photo cliches** — no handshakes, gears, lightbulbs, jigsaw pieces, globes.\n- **Match background tone to topic** — light for constructive topics, dark for technical/deep topics.\n- **If the article is about team/culture**, recommend a real photo (Category B) instead of generating.\n- **If `GOOGLE_API_KEY` is not available**, output the prompt for manual use and tell the user how to set up the key.\n",
|
|
103
103
|
"frontmatter": {
|
|
104
104
|
"name": "orbitant-image-creation",
|
|
105
|
-
"description": "Generates blog post thumbnail images for Orbitant following the brand's visual\nidentity, using Google's
|
|
105
|
+
"description": "Generates blog post thumbnail images for Orbitant following the brand's visual\nidentity, using Google's Gemini image API (Nano Banana 2). Activates when creating\nblog images, generating thumbnails, designing featured images for articles, or\nwhen someone needs a visual for an Orbitant insight/blog post. Use this skill\neven if the user just says \"I need an image for this article\", \"create a\nthumbnail\", \"generate a hero image\", or \"make a featured image\". Also triggers\nwhen the user mentions \"Nano Banana 2\", \"image generation\", or asks for a\nprompt for an AI image tool.\n",
|
|
106
106
|
"license": "MIT",
|
|
107
|
-
"version": "1.0.
|
|
107
|
+
"version": "1.0.1",
|
|
108
108
|
"metadata": {
|
|
109
109
|
"author": "orbitant",
|
|
110
110
|
"tags": "marketing, image, thumbnail, blog, visual, prompt, nano-banana-2, ai-image, imagen"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Image Creation Skill
|
|
2
2
|
|
|
3
|
-
Generates blog post thumbnails for the Orbitant engineering blog using Google's
|
|
3
|
+
Generates blog post thumbnails for the Orbitant engineering blog using Google's Gemini image API (Nano Banana 2), following the brand's visual identity system.
|
|
4
4
|
|
|
5
5
|
## Quick Start
|
|
6
6
|
|
|
@@ -32,7 +32,7 @@ Or just ask Claude: _"Generate a blog image about microservices"_ — the skill
|
|
|
32
32
|
| `--aspect` | Aspect ratio: `1:1`, `3:4`, `4:3`, `9:16`, `16:9` | `16:9` |
|
|
33
33
|
| `--count` | Number of variants (1–4) | `3` |
|
|
34
34
|
| `--watermark` | `white`, `black`, `none`, or `auto` | `auto` |
|
|
35
|
-
| `--model` |
|
|
35
|
+
| `--model` | Gemini image model ID | `gemini-3.1-flash-image` |
|
|
36
36
|
|
|
37
37
|
> **Note:** `--negative` is accepted but not supported by the current API. Bake negative constraints directly into the prompt instead.
|
|
38
38
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: orbitant-image-creation
|
|
3
3
|
description: |
|
|
4
4
|
Generates blog post thumbnail images for Orbitant following the brand's visual
|
|
5
|
-
identity, using Google's
|
|
5
|
+
identity, using Google's Gemini image API (Nano Banana 2). Activates when creating
|
|
6
6
|
blog images, generating thumbnails, designing featured images for articles, or
|
|
7
7
|
when someone needs a visual for an Orbitant insight/blog post. Use this skill
|
|
8
8
|
even if the user just says "I need an image for this article", "create a
|
|
@@ -10,7 +10,7 @@ description: |
|
|
|
10
10
|
when the user mentions "Nano Banana 2", "image generation", or asks for a
|
|
11
11
|
prompt for an AI image tool.
|
|
12
12
|
license: MIT
|
|
13
|
-
version: "1.0.
|
|
13
|
+
version: "1.0.1"
|
|
14
14
|
metadata:
|
|
15
15
|
author: orbitant
|
|
16
16
|
tags: marketing, image, thumbnail, blog, visual, prompt, nano-banana-2, ai-image, imagen
|
|
@@ -21,7 +21,7 @@ metadata:
|
|
|
21
21
|
You are a visual prompt engineer and image generator for the Orbitant engineering blog. Your job is to:
|
|
22
22
|
|
|
23
23
|
1. Craft a prompt matching Orbitant's visual identity
|
|
24
|
-
2. Generate the image by running the bundled script against Google's
|
|
24
|
+
2. Generate the image by running the bundled script against Google's Gemini image API
|
|
25
25
|
3. Deliver the final image file to the user
|
|
26
26
|
|
|
27
27
|
Respond in the same language as the user's request.
|
|
@@ -51,12 +51,12 @@ npm install @google/genai sharp
|
|
|
51
51
|
|
|
52
52
|
### Google API Key
|
|
53
53
|
|
|
54
|
-
You need a `GOOGLE_API_KEY` to call the
|
|
54
|
+
You need a `GOOGLE_API_KEY` to call the Gemini image API. There are two ways to get one:
|
|
55
55
|
|
|
56
56
|
| Option | How | Cost |
|
|
57
57
|
|--------|-----|------|
|
|
58
58
|
| **Google AI Studio** | Go to <https://aistudio.google.com/apikey> and create a key with your personal Google account | Free tier with daily limits |
|
|
59
|
-
| **Google Workspace** | Same link, but sign in with your organization's Workspace account. Many Workspace plans include Gemini
|
|
59
|
+
| **Google Workspace** | Same link, but sign in with your organization's Workspace account. Many Workspace plans include Gemini API access with generous quotas (check your admin console under **Apps → Additional Google services → Google AI Studio**) | Included in Workspace plans that have Gemini enabled |
|
|
60
60
|
|
|
61
61
|
> **Tip:** If your organization uses Google Workspace with Gemini enabled, you likely already have API access at no extra cost — ask your Workspace admin if unsure.
|
|
62
62
|
|
|
@@ -101,7 +101,7 @@ node plugins/orbitant-marketing/skills/image-creation/scripts/generate-image.mjs
|
|
|
101
101
|
|
|
102
102
|
If the API key is not set, the skill will craft the prompt and show it to the user so they can use it manually in AI Studio or another tool.
|
|
103
103
|
|
|
104
|
-
> **Note:** The `--negative` flag is accepted by the script but **not supported by
|
|
104
|
+
> **Note:** The `--negative` flag is accepted by the script but **not supported by Gemini image models** (`gemini-3.1-flash-image`) and is ignored with a warning. Instead of using `--negative`, incorporate negative constraints directly into the main prompt (e.g., "No red, orange, or yellow fire. No text, no words, no logos.").
|
|
105
105
|
|
|
106
106
|
### Reference Images Setup
|
|
107
107
|
|
|
@@ -121,7 +121,7 @@ Once available, **browse a few reference images** from `assets/reference/` befor
|
|
|
121
121
|
|
|
122
122
|
## Available Scripts
|
|
123
123
|
|
|
124
|
-
- **`scripts/generate-image.mjs`** — Generates images via Google's
|
|
124
|
+
- **`scripts/generate-image.mjs`** — Generates images via Google's Gemini image API and automatically composites the Orbitant watermark. Accepts prompt, output path, aspect ratio, model, count, and watermark tone. Returns JSON with file paths on success.
|
|
125
125
|
- **`scripts/scrape-insights-images.mjs`** — Downloads curated reference images from orbitant.com into `assets/reference/`. Skips existing files. Use `--force` to re-download.
|
|
126
126
|
|
|
127
127
|
Run `node scripts/generate-image.mjs --help` or `node scripts/scrape-insights-images.mjs --help` for full usage.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Generates Orbitant blog thumbnails using Google's
|
|
5
|
-
* and composites the Orbitant watermark
|
|
4
|
+
* Generates Orbitant blog thumbnails using Google's Gemini image
|
|
5
|
+
* generation API (Nano Banana) and composites the Orbitant watermark
|
|
6
|
+
* automatically.
|
|
6
7
|
*
|
|
7
8
|
* Usage:
|
|
8
9
|
* node scripts/generate-image.mjs --prompt "..." --output path/to/image.png [OPTIONS]
|
|
@@ -12,7 +13,7 @@
|
|
|
12
13
|
* --output FILE Output file path, .png (required)
|
|
13
14
|
* --negative TEXT Negative prompt (optional)
|
|
14
15
|
* --aspect RATIO 1:1, 3:4, 4:3, 9:16, 16:9 (default: 16:9)
|
|
15
|
-
* --model MODEL Model ID (default:
|
|
16
|
+
* --model MODEL Model ID (default: gemini-3.1-flash-image)
|
|
16
17
|
* --count N Number of images, 1-4 (default: 1)
|
|
17
18
|
* --watermark TONE Watermark variant: white, black, none (default: auto-detect)
|
|
18
19
|
* --help Show this help
|
|
@@ -62,7 +63,7 @@ Options:
|
|
|
62
63
|
--output FILE Output file path, .png (required)
|
|
63
64
|
--negative TEXT Negative prompt (optional)
|
|
64
65
|
--aspect RATIO 1:1, 3:4, 4:3, 9:16, 16:9 (default: 16:9)
|
|
65
|
-
--model MODEL Model ID (default:
|
|
66
|
+
--model MODEL Model ID (default: gemini-3.1-flash-image)
|
|
66
67
|
--count N Number of images, 1-4 (default: 1)
|
|
67
68
|
--watermark TONE white, black, or none (default: auto-detect from image brightness)
|
|
68
69
|
--help Show this help
|
|
@@ -77,7 +78,7 @@ function parseCliArgs() {
|
|
|
77
78
|
output: { type: "string" },
|
|
78
79
|
negative: { type: "string", default: "" },
|
|
79
80
|
aspect: { type: "string", default: "16:9" },
|
|
80
|
-
model: { type: "string", default: "
|
|
81
|
+
model: { type: "string", default: "gemini-3.1-flash-image" },
|
|
81
82
|
count: { type: "string", default: "3" },
|
|
82
83
|
watermark: { type: "string", default: "auto" },
|
|
83
84
|
help: { type: "boolean", default: false },
|
|
@@ -224,38 +225,46 @@ async function main() {
|
|
|
224
225
|
console.error(`Aspect ratio: ${args.aspect}`);
|
|
225
226
|
console.error(`Prompt: ${args.prompt.substring(0, 120)}...`);
|
|
226
227
|
|
|
227
|
-
|
|
228
|
-
try {
|
|
229
|
-
const config = {
|
|
230
|
-
numberOfImages: count,
|
|
231
|
-
aspectRatio: args.aspect,
|
|
232
|
-
};
|
|
233
|
-
if (args.negative) {
|
|
234
|
-
config.negativePrompt = args.negative;
|
|
235
|
-
}
|
|
236
|
-
response = await ai.models.generateImages({
|
|
237
|
-
model: args.model,
|
|
238
|
-
prompt: args.prompt,
|
|
239
|
-
config,
|
|
240
|
-
});
|
|
241
|
-
} catch (err) {
|
|
242
|
-
console.error(`API error: ${err.message}`);
|
|
243
|
-
process.exit(3);
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
if (!response.generatedImages || response.generatedImages.length === 0) {
|
|
228
|
+
if (args.negative) {
|
|
247
229
|
console.error(
|
|
248
|
-
"
|
|
230
|
+
"Warning: --negative is not supported by Gemini image models and will be ignored. " +
|
|
231
|
+
"Put negative constraints directly in the prompt instead."
|
|
249
232
|
);
|
|
250
|
-
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// Gemini image models return a single image per generateContent call,
|
|
236
|
+
// so request `count` times to keep the multi-image contract.
|
|
237
|
+
const imageBuffers = [];
|
|
238
|
+
for (let i = 0; i < count; i++) {
|
|
239
|
+
try {
|
|
240
|
+
const response = await ai.models.generateContent({
|
|
241
|
+
model: args.model,
|
|
242
|
+
contents: args.prompt,
|
|
243
|
+
config: {
|
|
244
|
+
responseModalities: ["IMAGE"],
|
|
245
|
+
imageConfig: { aspectRatio: args.aspect },
|
|
246
|
+
},
|
|
247
|
+
});
|
|
248
|
+
const parts = response.candidates?.[0]?.content?.parts ?? [];
|
|
249
|
+
const imagePart = parts.find((part) => part.inlineData?.data);
|
|
250
|
+
if (!imagePart) {
|
|
251
|
+
console.error(
|
|
252
|
+
"Error: API returned no images. The prompt may have been blocked by safety filters."
|
|
253
|
+
);
|
|
254
|
+
process.exit(3);
|
|
255
|
+
}
|
|
256
|
+
imageBuffers.push(Buffer.from(imagePart.inlineData.data, "base64"));
|
|
257
|
+
} catch (err) {
|
|
258
|
+
console.error(`API error: ${err.message}`);
|
|
259
|
+
process.exit(3);
|
|
260
|
+
}
|
|
251
261
|
}
|
|
252
262
|
|
|
253
263
|
await mkdir(dirname(args.output), { recursive: true });
|
|
254
264
|
|
|
255
265
|
const results = [];
|
|
256
|
-
for (let i = 0; i <
|
|
257
|
-
const
|
|
258
|
-
const originalBuffer = Buffer.from(imgBytes, "base64");
|
|
266
|
+
for (let i = 0; i < imageBuffers.length; i++) {
|
|
267
|
+
const originalBuffer = imageBuffers[i];
|
|
259
268
|
|
|
260
269
|
// Determine output paths
|
|
261
270
|
const basePath =
|