Skip to content

solspace/imagiterate-contentful

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Imagiterate

AI-powered image iteration tool for Contentful

Generate image variations using AI directly within your Contentful workflow


🎨 Overview

Imagiterate is a Contentful app that enables content creators to generate AI-powered image variations directly within the Contentful editor. Using Replicate's AI models, users can iterate on images by simply describing the changes they want, making it easy to create multiple versions of assets without leaving Contentful.

Key Features

  • ✨ AI-Powered Generation - Create image variations using natural language prompts
  • 🎯 Integrated Workflow - Works seamlessly within Contentful's field editor
  • πŸ“Έ Asset Management - Automatically saves generated images as Contentful assets
  • πŸ”„ Iterative Process - Build on previous iterations to refine your images
  • ⚑ Fast & Easy - Simple interface, no external tools needed
  • πŸ”’ Secure - API keys stored securely as instance parameters

πŸ“Έ Screenshots

See Imagiterate in action:

Field Editor

The Imagiterate field editor integrated into Contentful, showing a selected image with options to iterate or remove.

Field Preview

AI Generation Dialog

The AI-powered dialog where users can describe desired changes and generate image variations in real-time.

AI Dialog

Generated Result

Preview of the AI-generated image variation based on the user's prompt.

Generated Result

Saving Generated Asset

The generated image is automatically saved as a new Contentful asset and appears in the field.

Saving Generated Result

πŸš€ Quick Start

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/imagiterate-contentful.git
    cd imagiterate-contentful
  2. Install dependencies

    npm install
  3. Create App Definition in Contentful

    npm run create-app-definition

    Save the App Definition ID that's returned.

  4. Add App Locations

    npm run add-locations

    Select Media reference field type.

  5. Build and Upload

    npm run build
    npm run upload

    Enter your App Definition ID when prompted.

  6. Install in Your Space

    • Go to your Contentful space
    • Navigate to Apps β†’ Find "Imagiterate"
    • Click Install β†’ Select your space and environment

βš™οΈ Configuration

Setting Up Instance Parameters

  1. After installing the app, go to Apps β†’ Imagiterate β†’ Configuration
  2. Add the Replicate API Key:
  3. Save the configuration

Adding to Content Model

  1. Go to Content Model β†’ Your content type
  2. Add or edit a field of type Media (Asset)
  3. In field settings β†’ Appearance
  4. Under Editor interface, select Imagiterate
  5. Save the content type

πŸ“– Usage

Basic Workflow

  1. Select or Upload an Image

    • In an entry, use the Imagiterate field
    • Click "Choose asset" to select from your media library
    • Or click "Upload asset" to upload a new image
  2. Generate Variations

    • Click the "Iterate" button
    • Enter a prompt describing the changes you want (e.g., "make it more vibrant", "add a sunset background")
    • Click "Generate" and wait for the AI to create the variation
    • Preview the result in the dialog
  3. Save or Continue Iterating

    • Click "Save" to save the generated image as a new asset
    • Or generate another variation by entering a new prompt
  4. Remove Asset

    • Click "Remove" to clear the selected asset

Example Prompts

  • "Make the colors more vibrant and saturated"
  • "Add a sunset sky in the background"
  • "Convert to black and white with high contrast"
  • "Add a vintage film grain effect"
  • "Make it look like a watercolor painting"

πŸ› οΈ Development

Local Development

# Start development server
npm start

# The app will run on http://localhost:3000
# Note: To test properly, configure the app in Contentful first

Building for Production

# Build the app
npm run build

# Upload to Contentful
npm run upload

Available Scripts

  • npm start - Start development server (localhost:3000)
  • npm run build - Build for production
  • npm run create-app-definition - Create app definition in Contentful
  • npm run add-locations - Configure app locations
  • npm run upload - Upload built app to Contentful
  • npm run upload-ci - Upload using environment variables (for CI/CD)

CI/CD Deployment

Set these environment variables:

CONTENTFUL_ORG_ID=your_org_id
CONTENTFUL_APP_DEF_ID=your_app_def_id
CONTENTFUL_ACCESS_TOKEN=your_access_token

Then run:

npm run build
npm run upload-ci

πŸ› Troubleshooting

App Not Loading

  • Ensure the app is installed in your space
  • Verify the bundle is active in App Definition β†’ Bundles
  • Check that "Hosted by Contentful" is enabled (not pointing to localhost)

"App failed to load" Error

  • Make sure you've uploaded the latest bundle: npm run build && npm run upload
  • Verify the app is installed in your space
  • Check browser console for specific errors

Generation Not Working

  • Verify your Replicate API key is configured correctly
  • Check that you have credits/quota available on Replicate
  • Ensure an asset is selected before clicking "Iterate"
  • Check browser console for API errors

Field Not Showing App

  • Verify the app is added to the field's appearance settings
  • Make sure the field type is Media (Asset)
  • Check that the app is installed in your space

πŸ“ Requirements

  • Contentful: Organization account with app installation permissions
  • Replicate: API key and account with available credits
  • Node.js: 16+ for development
  • Browser: Modern browser with JavaScript enabled

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ‘€ Author

Solspace

πŸ”— Links


About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •