santa hat
deerdeer nosedeer glow
Sign In

How does the site know the prompt when I upload an image ?

Hi Folks,

I uploaded an image I have generated in ComfyUI into CivitAI. When I went back to look it had identified the prompt, shown the seed and settings, nodes used. Essentially, even after I have lost how I generated an image, it seems to be retrievable. I did not see anything stored in the image file in terms of meta data.

So how does it work ?



2 Answers

If you have Automatic1111 then you can check out the PngInfo section

Basically it's all within the image

The generation information is also metadata. However, they don't have a specific expression method so we can't directly view them in file attribute as other metadata. There's a lot of methos allowing you to get the gen info. Here is an example using Python's PIL library:

from PIL import Image
image ="Path to your image file.")
info =['parameters']

This simple program will output the generation parameters, such as prompt, negative prompt, sampler, steps, seed, model etc, in string type. CivitAI only need to parse the string, specifically, cut the string into pieces that contains the value of a specific parameter, to get the generation information.

Different generation interface may give different content of the string, and CivitAI seems to support AUTOMATIC1111 WebUI form. That's the reason why images generated by ComfyUI are unable to be read by it.

I hope this will help.

Your answer