Removes duplicate images/videos (same author, file name, dimensions, file size and blurhash) from Civitai feeds before they are rendered, so the masonry grid stays intact. Tested mainly on user profile pages.
Removes duplicate images/videos (same author, file name, dimensions, file size and blurhash) from Civitai feeds before they are rendered, so the masonry grid stays intact. Tested mainly on user profile pages.
Code written by Claude (Anthropic), tested by me.
Please report spam: this script only hides duplicates on your side. If you see an account flooding feeds with identical uploads, please report it to Civitai moderation.
Civitai loads feeds through tRPC (image.getInfinite). The response is { result: { data: <payload> } } where is written by one of two serializers, depending on which server pool answered (the site migrates superjson -> devalue pool by pool, and a single response can fall back to superjson):
The script wraps window.fetch, removes duplicate items from the items list of either format and hands the page a normal response. Removing items before the page renders them (instead of hiding them with CSS) keeps the virtualized masonry grid from leaving empty gaps.
Two items are duplicates when author id, file name, width, height and blurhash are all identical. The first copy in feed order is kept.
Pagination: every response carries nextCursor. A later request that contains that cursor (in the URL or in a POST body) continues the same "chain" and shares its memory of what was already shown. A request without a known cursor starts a fresh chain. This does not depend on how the request input is encoded, and keeps different feeds on the same page independent.
image.getInfinite procedure is processed. Feeds served by other procedures are left untouched.DEBUG = true at the top of the script and look for "[dedupe]" lines in the browser console.?batch=1, used by the site for some logged-in cohorts) come back as a stream and are NOT processed.The script makes no network requests of its own and sends nothing anywhere. It only filters Civitai's own API responses inside your browser.