Plus plan

Image to prompt

Write the text you would give an AI to recreate this picture
POST
/v1/ai/images/prompt

About this tool

This tool looks at a picture and writes a prompt, which is the text instruction you give an AI image tool so it makes a picture like this one. You can write it for Midjourney, Stable Diffusion, DALL-E, Flux or any tool, choose how long it is, and ask for a leave-out list and other versions. It uses AI, so treat the result as a starting point.
For example, you love the style of a picture and want to make similar ones with your favourite image AI.

How to use it

  1. Choose this tool.
  2. Add your picture with Upload, or drag and drop it.
  3. Choose which AI tool it is for, how long it should be, and how many other versions you want.
  4. Turn on the leave-out list or style naming if you need them, then press Generate.
  5. Copy the prompt from the result.

What you get back

You get a prompt as text on screen that you can copy and paste into an image AI tool.
TEST IT LIVE

Try Image to prompt in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
AI
Plan
Plus
Method
POST
Endpoint
/v1/ai/images/prompt
Tool ID
ai.images.prompt
Authentication
API key
Accepts
Text and settings
Background jobs
Yes
Usage group
Ai
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/ai/images/prompt" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'files=@document.pdf' \
  -F 'on_unsupported=error' \
  -F 'quality=standard' \
  -F 'target=generic'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.ai.images.prompt({
    "files": 'document.pdf',
    "on_unsupported": "error",
    "quality": "standard",
    "target": "generic"
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->ai()->images()->prompt([
    'files' => 'document.pdf',
    'on_unsupported' => 'error',
    'quality' => 'standard',
    'target' => 'generic',
]);
echo $result->requestId;
FAQ

Frequently asked questions

A prompt that would recreate a picture, written for Midjourney, Stable Diffusion, DALL-E, Flux or any model, with a negative prompt and variants; code enforces the word limit. Readiness: unbenchmarked (see GET /v1/ai/capabilities/images.prompt).

Classification: ai. Deterministic stages: file type detection from content, native PDF text extraction / OCR for documents, image normalisation (Sharp).

Image to prompt works from text and settings, so no file is needed. Every input is optional.

Not on the Free plan: Image to prompt is available on the Plus plan and above. Free accounts can upgrade any time to use it. Each run uses credits from your monthly allowance.

Send a POST request to /v1/ai/images/prompt with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.