Skip to content

deduplicate-assets

Use when removing duplicate images from an ad asset library before variant generation. Uses 3-layer deduplication — content hash, variant constraint, and platform sync check — to prevent redundant uploads and wasted ad spend.

ModelSource
sonnetpack: ad-assets
Full Reference

3-layer deduplication guard that runs before variant generation. Prevents exact duplicate images, redundant platform/placement crops, and re-uploading already-synced assets. Runs synchronously after classify-ad-assets and before generate-ad-variants. Returns a deduplicated asset list with a rejection report.

FactValue
Layer 1SHA-256 of Cloudinary public ID — catches exact duplicates
Layer 2Compound key assetId::platform::placement — catches variant duplicates
Layer 3sync-status.json read — skips already-synced variants
Treated as syncedstatus: 'synced' only — failed and uploading are retried
Pipeline positionAfter face-center-crop, before generate-ad-variants
I want to…File
Implement SHA-256 content hash deduplication (Layer 1)content-hash.md
Implement compound key variant constraint deduplication (Layer 2)variant-constraint.md
Implement sync status check, full deduplication pass, and report output (Layer 3)sync-check.md

Usage: Read the reference file matching your current task from the index above. Each file is self-contained with code examples and inline gotchas.


┏━ 🎯 deduplicate-assets ━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Deduplicating: [N] assets across [platform(s)] ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛