Skip to content

Instantly share code, notes, and snippets.

@tildebyte
Created October 25, 2022 04:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tildebyte/4b0026fb365134fb238a53c0099508e8 to your computer and use it in GitHub Desktop.
Save tildebyte/4b0026fb365134fb238a53c0099508e8 to your computer and use it in GitHub Desktop.
SD, negative prompting, and SEO pollution
From somewhere in the bowels of https://www.reddit.com/r/StableDiffusion/comments/y0t4pd/a_bizarre_experiment_with_negative_prompts/iru7rh8
by Ok_Entreprenuer_5833
If anyone is wondering why this effect happens (and they should be wondering if they want to push SD to it's limits) it's the SEO media marketing word cloud noise coming up in the labelling of the dataset SD was trained on.
I'll try not to be long winded, want to get back to my SD project but think it's valuable enough to put down here since this experiment is a clear visual aid for the idea.
Top searches in 2019 in my example here: (didn't use 2020 onward as results of covid would skew this out of normalization).
News, people, celebrities and Trump is up there among all those at the top.
Disney
Food/food blogs
Fashion
Royalty
Sex
Home furnishing/decorating
I hope that gets the picture across to anyone in thought about this. Look at those images above and read the above list again.
What happens is that media marketing types, including stock image people tag their images of EVERYTHING with this word cloud noise so that it's picked up by algorithms in the searches we all use.
Common Crawl scrapes all these images, bad tags included then SD gets trained on this data. Models are released, but the shit-tier labelling remains intact until pruned out. But there's billions of images and so much of it is infected by this noise. Current SD 1.4 is less than 900m parameters after extensive pruning but it's still there this noise in the labelling.
The diffuser is godlike. The API tokenizer is godlike. They're SO GOOD at what they do. The math is profound, magical with this latent space diffusion stuff.
But the labelling of the data is driving the diffuser to resolve into dogshit.
One day spent experimenting with a model trained on curated and meticulously labelled data in terms of coherency will show you all you need to know about this. Wow all of a sudden SD jumps up in coherency and quality, ya don't say.
So yeah, to sum up, get good with negative prompt understanding and don't just copy paste someone's negative prompt list since they just copy pasted from someone else who got good results. Do stuff like this to find out how to neg out the static from the signal and watch the quality of your images skyrocket as a result.
Pretty quick your negative list ends up with words like "pizza", "simpsons", et al. Even though what you're prompting has nothing to do with any of that even in a tangential way. It's some mad science shit, but to me it's fun cracking all this. Since I can't code and suck at math it's all I'm left with lol. Left handed artist here, SD lights up the right side of my brain when I use this thing, can barely sleep anymore way too inspired. Got really busy working on figuring all this out and LOVE this thread to showcase some of this stuff that's on my mind. Great clear examples here.
Oh one last thing, want to know why "mutant" works in negative prompts to make your faces look better?
It's not because it's negating mutant, it's because it's negating a ton of data tagged with New Mutants, now go look at the poster/cover for the movie New Mutants. See all those horrible extra heads? All those twisted ugly deformed extra heads? Yeah you see it now don't you.
So negging out mutants takes out a slew of data involving this horrible image. But why would that matter? Well here's why. That movie stars Maisie Williams, one of the most searched for actresses in 2019. That's why.
So she comes up in a TON of tags for otherwise harmless images, and they also include the tag "New Mutants" in that media marketing toxic word cloud that infects the data, since they want their images to be associated with all these popular searches.
So by negging out "mutant" you're getting rid of a ton of bad data associated with Maisie Williams improper tagging to drive SEO shit. In one word you cleaned up the data so the diffuser has a much easier time to resolve into coherent images of what you're after.
Damn, thought I said I'd try not to be long winded, oops.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment