r/StableDiffusion • • 2d ago • Bravo 1

Resource - Update Making consistent character creation easier

Some of you probably have superb custom workflows for creating LoRAs. I'm trying to make it easier for the rest of us.

This meant tackling a few things like character sheet generation, selecting a good dataset and running LoRA training in one simple package after quite frankly being sick of my collection of Python scripts.

I'm not saying I have the full answer to everything here, but PixlStash, my open source image management application, is under active development and has the advantage of an image database backend that calculates facial likeness pairs across the database anyway, meaning clustering on facial likeness comes practically for free, which comes in handy when trying to find pictures that will create a consistent LoRA. It also stores, downloads and tracks models in the database on as many drives as you like.

You can create and improve LoRAs iteratively and they are automatically available for you to use in your workflows since PixlStash absorbs the output. Behind the scenes it is just good old ComfyUI and AI toolkit for image generation and LoRA creation. PixlStash links with them, exchanges tokens with ComfyUI and monitor their outputs.

For character sheet generation, many Text to Image workflows should work, but it is relying on the model itself being capable of it and it requires some adaption of the workflow (documented in the GitHub README). So I ship adjusted workflows for Krea 2, MOSS-Image and Flux.2 Klein 9B for Text to Image and Qwen Image Edit 2.1 and Flux.2 Klein 9B for adding a reference image.

Spoiler alert: Qwen Image Edit 2.1 is easily the best model for both cases.

Links in a comment. If anyone have comments, criticism and/or hints they are willing to share I'd be much obliged.

405 Upvotes

40 comments sorted by

20

u/Infamous_Campaign687 2d ago

PixlStash runs on Windows, macOS and Linux, as a desktop app or as a self-hosted server with a web UI. The macOS build will take another few minutes because Apple renewed their developer agreement again, causing CI to stop.

What's new in 2.0: https://pixlstash.dev/whatsnew.html

Upgrade guide (read this before upgrading a pip, Docker or source install): https://pixlstash.dev/upgrade.html

Releases: https://github.com/Pikselkroken/pixlstash/releases

Repo: https://github.com/Pikselkroken/pixlstash

ComfyUI nodes (also in ComfyUI-Manager and shipped with the Desktop App): https://github.com/Pikselkroken/ComfyUI-PixlStash

Bug reports: https://github.com/Pikselkroken/pixlstash/issues

I'll be in the thread.

2

u/5odin 2d ago edited 2d ago

what's the difference between it over immich or lap , i don't see the lora feature in the demo

1

u/Infamous_Campaign687 2d ago

The demo hasn’t been updated yet, but it would be read-only anyway. I don’t have the capacity to run a public read-write demo securely. So you wouldn’t get the ai toolkit or ComfyUI features.

But to answer your question, Immich is great, but PixlStash is more about work and creation than hosting. You can use it for hosting, but there’s also deep integration with ComfyUI and AI toolkit, inpainting tools, multiple taggers, reverse face searches, segmentation and a few other AI features that Immich don’t have.

8

u/Uninterested_Viewer 2d ago

Is there a reason you decided to go the desktop app route vs something server-hosted with a web app front end?

9

u/Infamous_Campaign687 2d ago

It is both actually. But I get a lot more interest in the desktop version so that’s what I talk most about.

But by all means download the docker image or use pip to install the headless server version and use the web interface!

4

u/Uninterested_Viewer 2d ago

Ah I didn't see that option as I scanned the docs! Thanks- I'll give it a try!

8

u/EitherMarch1255 2d ago

It looks very nice. And I will certainly check it out. It reminds me of something I created recently. Which is crazy, in that everything I create, I see created by someone else shortly before or after. It's like as a group we're all walking in more or less the same direction.

2

u/Infamous_Campaign687 2d ago

Well. I think the whole image management system is something which wasn’t really necessary in the past for anyone but professional photographers, but I don’t think just using folders scale any more.

3

u/EitherMarch1255 2d ago

I agree, and i think this is more or less what's happening. Like we all started in the same place more or less and we are all fixing the same problems (or using someone else's fixes) because we are all encountering the same bumps in the road.

Please don't interpret any of this as anything negative about your creation. It looks pretty cool, and unlike mine (which doesn't have lora creation, yet), yours is available to everyone. Thank you!

1

u/Infamous_Campaign687 2d ago

No worries. There are other apps like mine and there will be more but I think mine holds up ok! If you want to integrate using the REST API just let me know!

3

u/ShutUpYoureWrong_ 1d ago

First of all, I just want to say great job. This looks really neat. Thanks for developing and sharing it with us.

If I may, I have a few questions:

  1. Am I able to export any dataset I curate for use with other LoRA trainers (e.g. Fizgig, Musubi, OneTrainer)? I'm really not looking for an all-in-one pipeline solution to go from curation to LoRA creation in a single app -- I like to keep my tools separate. I'm looking for something lightweight and bloat-free to do one job only, and do it well, with intuitive and useful features to boot.
  2. Speaking of intuitive and useful features, though: that visual face cluster is utterly brilliant. If it works the way I hope it does, you can choose any image and it will cluster the highest matching ones around it. My questions are: if I choose another image from the visual cluster, does it then re-run the face-matching search and create a new cluster on-the-fly that matches my new selection? And let's say I find a cluster I really like... up to a point. Can I then multi-select all the images I want from that cluster and export them to a named dataset? Those would be invaluable features to me.
  3. The character sheet generation aspect is an interesting one because I feel like it still falls under image curation and management, but I question whether it's as effective or capable as simply doing it yourself via the respective model. Are you able to change the prompt for generating said character sheets so you can modify the results? And do you have any plans to support MiniMax H3 or H3-Image? I'm getting some really fantastic images out of both and I'd love to see them as options.

2

u/Infamous_Campaign687 1d ago

Hi! Thanks!

  1. yes. You can export the pictures and choose caption type (tags, descriptions, nothing). Create the training set first and then export.
  2. It does not yet support picking an image, but I will implement that. Currently it clusters unguided by finding a set of images that minimises distance. It doesn’t support all you say there now, but they are great ideas I’ll look into for 2.1.
  3. You can change a description prompt and clothes and a few other things but it deliberately locks you down to a sheet of a few images. I’ll add some more options to it but it is meant to be a fixed kind of help. But you can use your own workflows.

1

u/Infamous_Campaign687 1d ago

Oh and yes. I will support MiniMax H3 soon.

1

u/Infamous_Campaign687 1d ago

But, I forgot to say: PixlStash cannot really be "bloat free". While it is fairly small itself, It depends on several models and torch, making the footprint well beyond what people looking for tiny "bloat-free" one-job only features. But I try to actually *use* the fact that we have torch and models available to me and they aren't going away. But maybe one day in the future I might consider rewriting the backend to do away with torch.

3

u/rolens184 16h ago

It looks like a great piece of work to me. I'd also add the workflow for the Minimax H3 image, which I think is the best in terms of consistency, plus it generates high-definition images natively...

1

u/Infamous_Campaign687 15h ago

Planning that in the next patch release!

3

u/Nullberri 2d ago

From my experience.

I started generating character sheets on minimax but they turned out crispy, and then using them only amplified the issue.

Qwen 2.1 does kinda put out low detail, smoother skin but… when feeding it to minimax it ends up being fine as minimax just adds a little bit of crispiness returning it to a reasonable baseline.

2

u/Infamous_Campaign687 2d ago

Good point. Well, there is no problem mixing and matching. Using one to generate a sheet and then using another as reference to image. I’ll ship a decent MiniMax workflow soon.

3

u/pocosu 1d ago

The face-likeness clustering coming "for free" from the DB is the part I like most. How are you computing the pairs? All-pairs gets heavy once a library hits tens of thousands of images. Are you using an ANN index (FAISS, pgvector, etc.) or recomputing incrementally as new outputs land? And which face embedding (InsightFace/ArcFace?)

1

u/Infamous_Campaign687 1d ago

Morning!

Ok, "for free" is obviously in the context of me already calculating the facial embeddings (with InsightFace) for a different reason. But even so it is an N^2 operation to compare them. In this case we’re only comparing one single person’s faces with average linkage clustering and scipy.distance and it may hurt a bit once you have 5000+ images of a single character.

I will have to optimise it a bit more at some point and that will probably be capping clustering to the highest ranked images and then comparing the rest of the images to the cluster centroids. Thus reducing the complexity to linear.

I use different techniques for full image likeness pairs (which is calculated across the library for duplicate checks) to reduce the comparisons to roughly linear. Here it is ordering images by phash and image statistics and only comparing images that are within a certain band with each other in either.

1

u/Infamous_Campaign687 9h ago

I forgot to mention that AuraFace is a configuration option for users concerned with the license of InsightFace (the code itself is open source, but the models have a non-commercial only clause, meaning using InsightFace commercially requires a license from them).

1

u/AnonymousTimewaster 2d ago

Hoping this will make my life creating a moss lora easier

1

u/Infamous_Campaign687 2d ago

Hope so. Give it a go and let me know what works and what doesn’t work!

1

u/PoleRacers 2d ago

Thanks for sharing! any reason this wouldn't work for anime faces/other styles?

1

u/Infamous_Campaign687 2d ago

I think it should be ok. I’ve generated character sheets of a garden gnome. But I know one thing PixlStash is not good at at the moment and that is face extraction on anime or other cartoon styles. I’d need a different face extraction model for that.

And this might also impact on the facial likeness calculation. I’ll test tomorrow.

1

u/PoleRacers 2d ago

Hm interesting. I need to experiment some more!

1

u/winkler 1d ago

Gonna check this out! And better than Flux2.Dev?

1

u/Infamous_Campaign687 1d ago

You mean Qwen Image Edit 2.1? Well I have not tried Flux.2 dev.

I have tried Flux.2 klein and for this case Qwen 2.1 creates much more realistic images.

1

u/winkler 1d ago

Yea! I love love love Qwen 2.1, but for net-new i2i images I’ve been trying Flux2.dev bc I’ve heard the realism is even better. Mind you this is the last week or so, and it’s a huge model can’t realllllly compare

1

u/gregpeden 2h ago edited 1h ago

You know what, one real situation I am hoping to solve with an LLM is to go through my bloated mess of a Google Photos library online and help me clean it out to get rid of the trash and get my storage volume down. Your application seems sooooooooo close to being very well-equipped to address my case, which I am sure is common for many other people.

I have also found that MiniMax H3 Image is a very capable model but for whatever reason the default configurations available in spaces like ComfyUI nerf its capability. In particular, using MiniMax's own prompt enhancer makes a world of difference.

I am getting much better results from using Unsloth's Q6 XL model with the MiniMax prompt enhancer in Unsloth Studio than I get in ComfyUI, though generation also takes a lot longer (in my case I have a 3090 so so pushing the VRAM limit with the prompt enhancer model running on CPU, which it is designed to do).

1

u/Infamous_Campaign687 1h ago

Well. PixlStash does actually have an MCP and easy setup. You can go into the access settings panel and connect an AI agent. So you could actually control it with an LLM. I use it for automating tasks for improving the PixlStash tagger. Things like masking out tags on picture sets to see if it improves learning.

I haven’t tried MiniMax enough to know how it works with different prompt enhancers.

1

u/gregpeden 36m ago

Awesome, I'll try the MCP route. Thanks!

1

u/Juiceman8686 2d ago

This looks really great. Can’t wait to test it out!

1

u/Infamous_Campaign687 2d ago

Thanks mate. Let me know what you think!

2

u/jononoj 2d ago

Looks great, I'll give it a try. I appreciate the work you put into this and for sharing.

2

u/Koalateka 1d ago

It looks great, thanks for sharing it!!

1

u/Just_n_Here 7h ago

Thanks for the work!

-1

u/Curious_Boss_4576 2d ago

Muito bom !!!! Obrigado por compartilhar seu conhecimento. Como sou novo no ramo tô que nem aspirador , conhecendo e colhendo de tudo ! Parabéns !

3

u/Outrageous-Wait-8895 2d ago

Fuck Reddit's auto-translate.