ファンサイトに戻る

PROMPT GUIDE

How to Extract a Prompt from an Image (Metadata and Tag Guessing)

When you want to know the prompt behind a picture, first check whether the image still carries its generation data. If it does, you can read the exact text. If not, you can only guess tags that get you close. This guide covers both methods and what to do when they fail.

Last updated: approx. 4 min read

The short answer

There are two ways to get a prompt from an image. If the PNG still holds its generation data, you can read it out as is; if not, a tagging tool can guess words that describe the picture. When the image belongs to someone else, respect what the creator intended.

How do you extract a prompt from an image? (Two methods)

Read the generation data if it is still there; if not, guess tags from the picture.

PNG files saved from Stable Diffusion interfaces (AUTOMATIC1111, Forge, ComfyUI and others) or from NovelAI often carry the prompt, negative prompt, seed, size and other settings as embedded text. This is called metadata. You cannot see it in the picture, but the right tool can read it. Images posted on social media or converted to JPEG or WebP usually lose this data. In that case the only option is a tool that looks at the picture and guesses Danbooru-style tags, so you can build a similar prompt.

MethodWhat you getAccuracyBest for
Read the generation data (metadata)Prompt, negative, seed, size and moreThe exact text that was writtenYour own PNGs and PNGs shared as files
Use a tag-guessing toolTags for objects, hair, outfit and compositionAn estimate (close words)Social media images, photos, hand-drawn art
Ask an AI to describe the pictureEnglish sentences describing the sceneGets the mood, misses detailsTools that read sentence prompts

Illustration usage rules

How do you read the generation data left in a PNG?

Just drop the original PNG into a tool that reads generation data. The PNG Metadata Viewer on this site does it entirely inside your browser.

Steps to read the generation data

  1. Get the original PNG if you can (images saved from social media or screenshots usually lost it)
  2. Open the PNG Metadata Viewer page and drop the image in
  3. Check whether fields such as prompt, negative prompt, seed and size appear
  4. Copy the parts you need into your notes or your prompt box
  5. To get the same picture again, also match the model, size and seed (the prompt alone will not reproduce it)

Rinka's tips

  • Re-saving, compressing or converting an image removes the generation data. Always read it from the file before any conversion
  • ComfyUI images may store the whole workflow instead of a single prompt. Drop the image into ComfyUI to load every step
  • If you want to remove the data before sharing your own image, re-save it with the image compressor and no metadata will remain

How seed values let you redraw the same picture: What Is a Seed? Fixed, Random, and Reproducing the Same Image →

How do you guess tags from an image with no generation data?

Use a tool that reads the picture and outputs tags (a tagger), then tidy the tags yourself.

A tag-guessing tool looks at the picture and outputs tags such as 1girl, long hair and school uniform, each with a confidence score. Some run as extensions inside a Stable Diffusion interface, some as ComfyUI nodes, some on the web; names and usage change between versions, so check each tool's own documentation. Rather than using the output as is, reorder the tags as number of people, appearance, outfit, pose, background and style, and delete low-confidence or unrelated tags. The prompt becomes much easier to use.

Guessed tagWhat to doWhy
High-confidence tagsKeep themThey are usually key features of the picture
Low-confidence tagsDelete them or check by eyeMix-ups with similar things creep in
Two tags with the same meaningMerge into oneDoubling makes the element too strong
Series or character name tagsRemove them for your own workThey pull toward someone else's work or character
Style and quality tagsAdd your own insteadGuessing rarely gets these right

What if you cannot extract the prompt? (Common mistakes and fixes)

The most common cause is that the generation data was lost when the image was converted or posted.

ProblemCauseFix
Nothing shows upThe data was removed when posting or re-savingFind the original PNG, or switch to tag guessing
Text is garbledNon-English text was stored in a different encodingTry another reader, or rewrite only the parts you need
The prompt was read but the picture differsModel, size, seed or sampler are differentMatch every other field in the generation data too
Guessed tags give a totally different pictureLow-confidence or style tags are mixed inCut down to about 10 tags, reorder them, and add back slowly
The workflow will not loadIt uses nodes or extensions you do not haveCheck the names of the missing nodes and install them, or rebuild another way

Is it okay to pull prompts from other people's work? (Things to keep in mind)

Reading to learn is one thing, but avoid copying the work itself or using it in ways the creator would not want.

  • Whether a creator shares generation data is their choice. Being able to read it does not mean you may use it freely
  • Avoid adding series, artist or character names to copy someone else's style or character
  • When you use a prompt as a reference, rebuild it around what you want to draw
  • Every posting site and service has its own rules, so check the terms where you post

To look up what a guessed tag means: How to Look Up Danbooru Tags (Finding the Correct Tag Name) →

To turn tags into a sentence prompt: Tag Prompts vs Natural Language Prompts (Which to Use?) →

Copy-paste: a template for tidying guessed tags

Reorder guessed tags in this order to make them easier to use. Replace the parts in brackets.

1girl, solo, [hair length and style], [eye color], [outfit], [pose], [expression], [place], [light], [framing]
1girl, solo, long hair, red eyes, white sweater, sitting, smile, library, window, sunlight, upper body

FAQ

Frequently Asked Questions

How do I extract a prompt from an image?

If the original PNG still holds its generation data, drop it into a tool like the PNG Metadata Viewer and read it out. For images without data, use a tag-guessing tool to build similar tags.

Can I read the prompt of an image saved from X or pixiv?

Posted images are usually converted, so the generation data is often gone. Unless the creator wrote the prompt in the description, guessing tags is the realistic option.

Why does the extracted prompt not give the same picture?

To get the same picture you also need the same model, size, seed, sampler and step count. The prompt alone produces a different image.

How do I remove generation data from my own images?

Re-saving with an image compressor redraws the image, so no metadata remains. Save the generation data separately first if you want to keep it.

RINKA WORLD

Play in Rinka World

MORE

You may also like