
By Solspace
Prompt an AI to iterate on uploaded images and save them to Strapi's backend.
released October 31, 2025
npm install @solspace/strapi-plugin-imagiteratePrompt an AI to iterate on uploaded images and save them to Strapi's backend.
To install this plugin, you need to add an NPM dependency to your Strapi application.
# Using Yarn
yarn add @solspace/strapi-plugin-imagiterate
# Or using PNPM
pnpm add @solspace/strapi-plugin-imagiterate
# Or using NPM
npm install @solspace/strapi-plugin-imagiterateThis plugin has an interface within the Strapi Admin Panel as well as API endpoints for use in your websites.
This plugin creates an AI image editing interface in the Strapi Admin Panel. You can find it as a widget in your Strapi home screen or as a custom field in the Imagiterate Uploads Collection.
Users can iterate on images and save their work as Strapi Media Assets. The plugin also generates alternative text for images using AI.
This plugin also exposes two Strapi API endpoints, one for initial image uploads and another for subsequent image iterations.
Developers can build front-end applications that consume this API and allow users to upload an image along with an editing prompt. The AI modifies the image and returns the modified version through the API. The developer's front-end application can then allow the user to provide further editing prompts to iterate on subsequent modified images.
All image uploads and modifications are saved to the Strapi back-end in the Imagiterate Uploads collection. The images are saved as Strapi Media Library records attached to a main collection entry.
This plugin is optimized for and currently uses the AI image editing service provider Replicate.
.env
# Replicate API Token
REPLICATE_API_TOKEN=r8_HrsCGGANKqOTmmJQhsbpIHBNMBOfHwz9JMaiQ
# Replicate AI Model
REPLICATE_AI_MODEL=black-forest-labs/flux-kontext-pro
# Replicate Caption Model
REPLICATE_CAPTION_MODEL=salesforce/blip:2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746config/plugins.ts
export default ({ env }) => ({
'imagiterate': {
enabled: true,
config: {
replicateApiToken: env('REPLICATE_API_TOKEN'),
replicateAiModel: env('REPLICATE_AI_MODEL'),
replicateCaptionModel: env('REPLICATE_CAPTION_MODEL'),
},
},
});When you choose to use the Imagiterate API, access and permissions for Imagiterate API endpoints is managed through Strapi. You can create a dedicated API token in Strapi and use that in your API calls. Enable both iterate and upload controller actions.
It is strongly recommended that you not enable API access through User & Permissions Plugin Roles.
There are two API endpoints for Imagiterate; Upload and Iterate. The upload endpoint takes the original image file along with a prompt. That original image is edited, saved to the Strapi backend and returned along with some other data. The iterate endpoint receives an image url and a prompt and edits the given image. That new image is saved to the Strapi backend and returned with additional data.
POST /api/imagiterate/upload
The upload endpoint expects FormData.
const formData = new FormData();
formData.append("image", originalImageFile);
formData.append("prompt", currentPrompt);Two values are expected:
The upload method creates a new entry in the Imagiterate Uploads collection. It returns that object in a standard Strapi API response for a Document Service findOne() call with some additions.
POST /api/imagiterate/iterate
The iterate endpoint expects a standard POST request payload. Four values are required:
AI is not cheap. Replicate charges $0.04 per image output for the black-forest-labs/flux-kontext-pro AI model. This is an excellent model, but beware of costs accumulating.
Solspace, Inc. is not responsible for any costs incurred through your use of Imagirate and its integration with the Replicate AI service.
Share your work with the community and get it listed in the Strapi ecosystem for everyone to discover and use.
Submit
