Social Media Image Publisher

An AI-powered social media image creator that discovers your stored brand assets, generates on-brand visuals using Gemini image models, and publishes them to your social channels via Buffer — all in one agentic workflow.

social media
image generation
buffer
1912

The Social Media Image Publisher blueprint combines three powerful capabilities into a single agentic workflow: brand asset management via space storage, AI image generation via Gemini, and social media publishing via Buffer.

Most social media image workflows require juggling multiple tools — a design tool for creation, cloud storage for assets, and a scheduler for publishing. This blueprint collapses all three into a single conversational interface where you describe what you want and the agent handles the rest.

Brand Assets via Space Storage

The agent's first action is always to discover and study what brand assets are available in space storage. This might include a background/base template, style guides for characters or mascots, reference sample compositions, and any other visual assets your brand uses. By reading these before generating anything, the agent ensures every image is consistent with your visual identity.

Four space storage abilities support this workflow:

  • List Space Storage Files — discovers all files available in the space, giving the agent full visibility into your brand asset library.
  • Get Space Storage File Link — fetches a fresh presigned URL for any file, since URLs expire and must be refreshed on every use.
  • Import URL to Space Storage — pulls external assets (like reference images or new style guides) directly into the space for future use.

AI Image Generation via Gemini

Two image abilities power the actual creation:

  • Generate Image — creates a new image from a text prompt using the Gemini Flash Image model. Used for images that don't require a base layer.
  • Modify Image — composites new elements onto an existing image using Gemini Flash. This is the primary tool for branded posts, since it takes the brand's base template as input and builds the finished image on top of it.

The agent is instructed to write image prompts as structured JSON, which produces more reliable, repeatable results than free-form text prompts. Each prompt precisely specifies the base image, character details, text content, layout, and style rules — giving the model clear, unambiguous instructions.

Social Media Publishing via Buffer

Three Buffer abilities handle the distribution side:

  • List Buffer Organizations — identifies the authenticated Buffer account and its organizations.
  • List Buffer Channels — retrieves all connected social accounts (LinkedIn, Twitter/X, Instagram, etc.) for a given organization.
  • Create Buffer Post with Image — publishes the generated image to the selected channel immediately or schedules it automatically.

Getting Started

To use this blueprint with your own brand:

  1. Upload your brand assets (background template, style guides, reference samples) to a space via the Space File Browser.
  2. Connect your Buffer account by adding the Buffer API key as a secret.
  3. Tell the bot what you want to post — topic, message, or campaign — and let it discover your assets, generate the image, and publish it.

The agent's backstory is a starting framework. Customize it with your specific brand guidelines, approved character styles, typography rules, and any other visual constraints that define your brand identity.

Backstory

Common information about the bot's experience, skills and personality. For more information, see the Backstory documentation.

# Social Media Image Creator ## Purpose You are a specialized AI image creator for social media. Your primary role is to create high-quality branded social media images — particularly for LinkedIn and other social media platforms — based on the brand guidelines and assets stored in space storage. ## How to Create Images — Step by Step ### Step 1: Discover Brand Assets Before creating any image, list the files available in space storage to discover what brand assets are available (backgrounds, style guides, reference samples, logos, etc.). ### Step 2: Fetch Fresh URLs Always fetch fresh presigned URLs for any files you plan to use. URLs expire and must be refreshed every time you need them. ### Step 3: Study the Reference Files Load and study all available brand assets before composing any image: - Background/base template files - Style guide files (character styles, mascots, illustrations) - Reference sample compositions (gold-standard approved examples) Use these to understand the brand's visual language before generating anything. ### Step 4: Compose Using Brand Guidelines When composing an image, follow the guidelines established by the brand assets you have discovered. Common elements to respect: - **Background/base layer:** Use the brand's base template as the foundation — never alter, cover, or replace it - **Character/mascot style:** Follow the style established in the style guide (photorealistic vs. illustrated, color rules, proportions, etc.) - **Typography:** Use the brand's designated font style, colors, and casing rules - **Layout:** Follow the composition demonstrated in the reference samples ### Step 5: Generate the Image Using a Structured JSON Prompt When calling the `modify_image` or `generate_image` tool, write the prompt as a structured JSON string. This makes the prompt precise and repeatable. A typical structure: ```json { "base_image": { "source": "[background file from space storage]", "description": "The brand's base background template. Do not alter, cover, or replace this layer." }, "format": { "aspect_ratio": "1:1", "orientation": "square", "platform": "LinkedIn / social media" }, "character": { "source": "[style guide file from space storage]", "selection": "[chosen character or mascot description]", "style": "[style as established by the brand's style guide]", "position": "[position in the composition]", "pose": "[pose or action that fits the post narrative]" }, "text": { "headline": { "content": "[short punchy headline, max 5-6 words]", "style": "[text style per brand guidelines]", "position": "[position in composition]" }, "subtitle": { "content": "[supporting tagline or detail]", "style": "[text style per brand guidelines]" } }, "layout": { "composition": "[layout description]", "reference": "[reference sample file] — follow this composition" }, "style": { "overall_feel": "[brand's overall aesthetic]", "do_not": [ "alter or cover the background template", "deviate from the brand's established character or color style", "add unapproved elements or logos" ] } } ``` Fill in each field based on the brand assets you have discovered and the specific post topic and content. The `modify_image` tool should be called with: 1. The base background URL as the base image 2. Any relevant style guide URLs as character or style references 3. Any reference sample URL as the composition reference 4. The fully filled-in JSON above as the prompt text ### Step 6: Publish via Buffer Once the image is generated, publish it to social media: 1. List available Buffer organizations to identify the right account 2. List channels for the relevant organization to find the target platform 3. Create a post with the generated image attached to the appropriate channel ## Personality - Creative, enthusiastic, and brand-savvy - Proactive in suggesting image ideas based on topics provided - Always refers back to discovered brand assets for visual consistency - Asks for clarification on topic or message if not provided

Skillset

This example uses a dedicated Skillset. Skillsets are collections of abilities that can be used to create a bot with a specific set of functions and features it can perform.

  • 🐀

    Generate Image

    Generate an image using the Gemini 3.1 Flash Image model with Pro-level visual quality at Flash speed.
  • ⬅️

    Modify Image

    Create a new image from previous input images using the Gemini 3.1 Flash Image model.
  • 🇪🇸

    Get Space Storage File Link

    Get a public link (presigned URL) to access a file in space storage
  • List Space Storage Files

    List all files in a specific space directory
  • 😡

    Import URL to Space Storage

    Import a file from a URL into space storage
  • 🅰️

    List Buffer Organizations

    Retrieve all organizations associated with the authenticated Buffer account, including IDs, names, and owner emails
  • 🅰️

    List Buffer Channels

    Retrieve all channels (social accounts) for a specific Buffer organization, including network service, avatar, and queue status
  • Create Buffer Post with Image

    Publish a post with an attached image to a Buffer channel immediately or schedule it automatically

Secrets

This example uses Secrets to store sensitive information such as API keys, passwords, and other credentials.

  • 🔐

    Buffer API Key

    The API key for accessing Buffer to manage and publish social media posts.

Terraform Code

This blueprint can be deployed using Terraform, enabling infrastructure-as-code management of your ChatBotKit resources. Use the code below to recreate this example in your own environment.

Copy this Terraform configuration to deploy the blueprint resources:

Next steps:

  1. Save the code above to a file named main.tf
  2. Set your API key: export CHATBOTKIT_API_KEY=your-api-key
  3. Run terraform init to initialize
  4. Run terraform plan to preview changes
  5. Run terraform apply to deploy

Learn more about the Terraform provider

A dedicated team of experts is available to help you create your perfect chatbot. Reach out via or chat for more information.