Sign In

The Invisible Payload: Hidden PNG Metadata and Our Clean-Room CivitAI Workflow

0

The Invisible Payload: Hidden PNG Metadata and Our Clean-Room CivitAI Workflow

When creators talk about an image, we usually mean the pixels.

The face. The composition. The lighting. The anatomy. The final grade.

But a PNG can carry another layer that is completely invisible in the gallery: embedded text fields containing a prompt, workflow data, generation settings, software information, or other payloads added by the tool that saved it.

We learned to treat that invisible layer as part of the publication surface.

This article explains the incident that forced us to inspect our files, what we were able to prove, what we were not able to prove, and the clean-room pipeline we now use before uploading publication images.

The short version is:

Preserve the raw generation file. Publish a freshly encoded image. Verify that the decoded pixels are unchanged. Keep provenance in a separate sidecar manifest.

That sounds simple. The important part is proving every step.

The Incident That Changed Our Upload Boundary

We had a metadata-related incident while publishing AI-generated work to CivitAI. A platform result looked suspicious enough that we stopped treating the PNG as a passive container and inspected the file itself.

One of our raw ComfyUI PNGs contained an embedded prompt field with 2,317 characters. None of those characters were visible in the image.

That discovery established a fact:

The file contained more than the pixels we intended to publish.

It did not establish that the hidden prompt caused a particular CivitAI score, moderation outcome, visibility change, or ranking effect.

That distinction matters.

CivitAI scans uploads and assigns content ratings, but its internal ranking, scoring, and moderation systems are not fully observable to creators. A suspicious correlation is not proof of causation. We therefore separated the problem into two questions:

  1. Can we prove that raw generation files contain invisible payloads?

  2. Can we create a publication copy with identical decoded pixels and no embedded image-info fields?

The answer to both was yes.

The answer to “did this payload cause the platform result?” remains unknown.

What We Proved

We ran a local reproduction on a real ComfyUI PNG and then validated the same sanitation invariant across a 120-image publication wave.

  • Raw PNG embedded metadata keys: prompt

  • Raw prompt field length: 2,317 characters

  • Clean PNG embedded image info: {}

  • Decoded pixel digest match: PASS

  • Dimensions match: PASS

  • Wave-scale clean images: 120

  • Wave-scale metadata-empty images: 120

  • Wave-scale pixel-digest matches: 120

  • Unique destination file hashes: 120

The raw and clean files had different file hashes and different byte sizes. That is expected: the containers were encoded differently.

The decoded RGB pixel digest was identical.

That is the test that mattered.

What We Did Not Prove

We did not prove that:

  • embedded ComfyUI metadata automatically harms a CivitAI upload;

  • a prompt field changes a model score;

  • metadata changes reach, ranking, moderation, or monetization;

  • every ComfyUI PNG contains metadata;

  • removing metadata repairs a file that has already been uploaded.

Some ComfyUI servers can be launched with metadata disabled. Some workflows or nodes may save different fields. JPEG, WebP, PNG, and video containers also behave differently.

Our conclusion is therefore deliberately narrow:

A publication pipeline should control the payload it uploads, even when the platform effect of an uncontrolled payload is unknown.

That is risk reduction, not superstition.

Why Copying or Renaming the File Does Not Clean It

Changing:

raw_output_00001_.png

to:

final_gallery_cover.png

changes the filename.

It does not decode the image, remove PNG text chunks, or write a new container.

Copying the file preserves the original bytes. Renaming it preserves the original bytes. Moving it to another folder preserves the original bytes.

If the payload is embedded inside the file, the file must be re-encoded.

The Clean-Room Publication Pipeline

Our production rule is now:

  1. Preserve the raw source. Never destroy the original generation artifact.

  2. Finish visual review first. Do not sanitize rejected images.

  3. Decode the approved source.

  4. Convert to a declared publication mode, normally RGB.

  5. Write a fresh PNG without copying the source metadata object.

  6. Reopen the destination file.

  7. Require the destination metadata dictionary to be empty.

  8. Compare dimensions.

  9. Compare a digest of the decoded pixel bytes.

  10. Record source and destination SHA-256 values in a sidecar manifest.

  11. Upload only the clean publication copy.

The raw file and the upload file have different jobs:

  • Raw file: reproducibility, debugging, workflow recovery.

  • Publication file: controlled external surface.

  • Sidecar manifest: provenance, hashes, settings, lineage, and verification.

Minimal Python Example

The following pattern uses Pillow:

from pathlib import Path
import hashlib

from PIL import Image


def pixel_digest(image: Image.Image) -> str:
    rgb = image.convert("RGB")
    digest = hashlib.sha256()
    digest.update(f"{rgb.mode}:{rgb.width}x{rgb.height}:".encode("ascii"))
    digest.update(rgb.tobytes())
    return digest.hexdigest()


source_path = Path("approved_raw.png")
clean_path = Path("publication_clean.png")

with Image.open(source_path) as source:
    source.load()
    source_rgb = source.convert("RGB")
    source_pixels = pixel_digest(source_rgb)
    source_size = source_rgb.size
    source_rgb.save(clean_path, format="PNG")

with Image.open(clean_path) as clean:
    clean.load()
    clean_pixels = pixel_digest(clean)

    assert clean.info == {}
    assert clean.size == source_size
    assert clean_pixels == source_pixels

The important detail is what the code does not do:

clean.save(..., pnginfo=source.info)

Do not pass the source metadata into the publication file unless you have explicitly decided that each field belongs there.

File Hashes and Pixel Digests Answer Different Questions

A SHA-256 hash of the complete file answers:

Are these container bytes exactly identical?

A digest of normalized decoded pixels answers:

Does the image display the same pixel content after decoding?

After sanitation, the complete-file hashes should usually differ because the metadata and encoding changed.

The pixel digest should match.

We record both:

{
  "source_sha256": "…",
  "destination_sha256": "…",
  "pixel_digest": "…",
  "metadata_empty": true,
  "dimensions": [768, 1024],
  "mode": "RGB"
}

This gives us a verifiable chain from approved raw render to publication asset.

Do Not Confuse Metadata Removal With Provenance Destruction

There is a dangerous overcorrection:

“If metadata creates risk, delete every trace of how the image was made.”

That is not our recommendation.

Creators may need generation details for:

  • reproducibility;

  • platform disclosure;

  • licensing records;

  • moderation disputes;

  • model-resource attribution;

  • mature uploaded comic panels;

  • future edits or remasters.

CivitAI's current Comic Creator documentation states that a mature uploaded or imported panel may be blocked from publication when the platform cannot verify that it was AI-generated. The creator may then need to add generation details such as the prompt, sampler, steps, and other settings.

That is why our architecture separates embedded upload metadata from retained provenance.

We remove uncontrolled payloads from the image container. We preserve the useful facts in a deliberate sidecar record.

The ideal publication package is not “an anonymous clean file.”

It is:

publication_clean.png
publication_manifest.json

The image contains only the intended visual asset. The manifest contains the facts we may need later.

What About Files Already Uploaded?

Cleaning a local file does not mutate the copy already stored by a platform.

If an uploaded asset must be replaced, the sequence is manual:

  1. create and verify the clean local replacement;

  2. preserve the old upload's identifiers and context;

  3. remove or replace the remote asset using the platform's supported workflow;

  4. upload the clean file;

  5. reattach any required resource, prompt, or generation information deliberately;

  6. verify the live result.

There is no local command that retroactively cleans a remote upload.

Our 120-Image Production Result

We applied the pipeline to six galleries containing twenty images each.

The final machine checks reported:

  • 120/120 publication files reopened with an empty metadata dictionary;

  • 120/120 destination pixel digests matched their approved sources;

  • 120/120 destination hashes were unique;

  • all raw ComfyUI sources remained preserved separately;

  • only the clean publication directories were exposed for manual upload.

This turned sanitation from a one-off script into a release gate.

An image could be visually excellent and still fail the publication gate if:

  • the source hash changed;

  • the destination metadata was not empty;

  • the pixel digest changed;

  • the dimensions changed;

  • the destination was duplicated;

  • the file was outside the approved output set.

Practical Checklist

Before uploading a gallery:

  • ☐ Preserve the raw generation files.

  • ☐ Complete visual and identity review.

  • ☐ Decode approved images into a declared color mode.

  • ☐ Save fresh publication files.

  • ☐ Reopen every destination.

  • ☐ Verify empty embedded image info.

  • ☐ Verify dimensions.

  • ☐ Verify decoded pixel digests.

  • ☐ Verify unique destination hashes.

  • ☐ Keep prompt, model, seed, workflow, and attribution in a sidecar manifest.

  • ☐ Upload only from the publication directory.

  • ☐ Remember that cleaning local files does not alter previous uploads.

The Bigger Lesson

The mistake was not that a tool embedded useful information.

The mistake was allowing the generation layer and the publication layer to be the same thing.

Raw generation artifacts are working files. They are allowed to be verbose, reproducible, and tool-specific.

Publication assets are external interfaces. They should be deliberate, minimal, verified, and stable.

Once we treated image release like software release engineering, the solution became obvious:

Build from the approved source. Strip accidental state. Prove the visible output did not change. Preserve provenance outside the deliverable.

The pixels are the artwork.

The container is part of the product.

And invisible payloads deserve a release gate too.


Evidence and Scope

This article is based on a local reproduction using a ComfyUI PNG with a 2,317-character embedded prompt field and a 120-image production sanitation run. The sanitation behavior and pixel-preservation checks were reproduced locally. No claim is made that hidden metadata caused a specific CivitAI score, ranking, moderation, or monetization result.

Official CivitAI references:

0

Comments