AI Asset Organizer

AI Asset Organizer is a free agent skill maintained by Scopeful. It teaches an AI coding agent such as Claude Code, Cursor, Windsurf or Codex how to drive this tool correctly, so you do not have to re-explain it every session. Every published Scopeful skill is free and the install command is public, with no sign-in required. Scopeful also tracks hand-verified USD pricing for 39 AI creative tools at https://www.scopeful.org/tools.

Clean up, dedupe, and sort a folder of AI-generated images, recovering the prompts hidden inside.

Tags: organization, deduplication

Reference


name: ai-asset-organizer description: Use this skill whenever the user wants to clean up, deduplicate, rename, or sort a folder full of AI-generated images or videos. Triggers include "organize my Downloads", "my Midjourney folder is a mess", "find duplicate images", "recover the prompts from these images", "sort my generations", "rename these AI images", or any mention of folders full of files like u3894_v7_upscaled.png. Reads embedded prompt metadata (ComfyUI, A1111, Midjourney, InvokeAI), dedupes by content hash, and sorts into a clean structure. Safe by default — dry-run plan first, moves instead of deletes.

AI Asset Organizer

Every AI creative has the same folder: 4,000 files named u3894838_a_beautiful_sunset_v7_upscaled (3).png. This skill turns it into a browsable library — and recovers the prompts hiding inside the files.

Safety rules (non-negotiable)

  1. Dry-run first. Print the full plan (what moves where, what's a duplicate) and get an explicit yes before touching anything.
  2. Never delete. Duplicates move to _duplicates/, unsortable files to _unsorted/. The user empties folders, not you.
  3. Never overwrite. On name collision, append -2, -3.
  4. Copy nothing off the machine. Everything runs locally.

Workflow

1. Inventory

find "$DIR" -maxdepth 1 -type f \( -iname "*.png" -o -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.webp" -o -iname "*.mp4" -o -iname "*.mov" -o -iname "*.gif" \) | wc -l
du -sh "$DIR"

Report counts by extension and total size before proposing anything.

2. Extract embedded prompts

Generators hide the prompt inside the file. Check in this order:

Source Where the prompt lives How to read
A1111 / Forge / SD.Next PNG tEXt chunk parameters exiftool -Parameters file.png
ComfyUI PNG chunks prompt + workflow (JSON) exiftool -Prompt -Workflow file.png
InvokeAI PNG chunk invokeai_metadata exiftool, same pattern
Midjourney (web download) Filename: username_prompt_words_jobid.png; sometimes XMP Description parse filename + exiftool -Description
Most video gens Usually nothing embedded fall back to filename + date

Without exiftool, use Python:

from PIL import Image
img = Image.open(path)
print(img.info)   # dict: 'parameters', 'prompt', 'workflow', etc.

Detect the generator per file from which keys exist. If nothing is embedded, classify by filename pattern (u[0-9]+_ → Midjourney legacy, ComfyUI_00123_ → ComfyUI, etc.).

3. Dedupe

Exact duplicates by content hash:

find "$DIR" -maxdepth 1 -type f -print0 | xargs -0 sha256sum | sort | awk 'seen[$1]++ {print $2}'

Keep the copy with the best name (or oldest mtime); list the rest as "move to _duplicates/". Flag file (1).png / file (2).png families even when hashes differ — they're near-dupe download artifacts; show them side by side in the plan, let the user decide.

4. Rename

Convention (ask the user if they want a different one):

YYYY-MM-DD_generator_prompt-slug_hash8.ext
2026-06-14_midjourney_steel-bottle-marble_a3f9c2d1.png

5. Sort

Default structure (confirm before moving):

sorted/
  midjourney/2026-06/
  comfyui/2026-06/
  seedance/2026-07/
  _videos/
  _duplicates/
  _unsorted/

Alternative when the user works per project: ask for 3–6 project keywords and route by prompt-text match instead of generator.

6. Report

End with: files processed, duplicates found (and MB reclaimed if the user empties _duplicates/), prompts recovered vs missing, and a prompts.csv (filename, generator, date, full recovered prompt) written next to sorted/ — the searchable index of everything they ever generated.

Requirements

exiftool preferred (brew install exiftool / apt install libimage-exiftool-perl / Windows: winget install OliverBetz.ExifTool); Python + Pillow as fallback. Everything else is stock shell.