Change-Your-Style named after the popular Nigerian rhyme is a Stable Diffusion application that brings together the concept of Image to Image and Textual Inversion. It changes the concept/style of input images (preferrably portraits) to one of seven predefined styles.
It uses a custom stable diffusion loop with an image as the starting point (input image) and a new 'learned' style embedding slipped into the embedding of a prompt - which acts now as just a placeholder actually.
Diagram from here
Diagram from here
- Windows
python venv env_name
cd env_name
Scripts/activate
python -m pip --upgrade pip
python -m pip install -r requirements.txt
- Unix/Linux
sh setup.sh
│ main.py
│ app.py
│ utils.py
│ setup.sh
|
├── models
│ ├──scheduler.pt
│ ├──text_encoder.pt
│ ├──tokenizer.pt
│ ├──unet.pt
| └──vae.pt
|
└── learned_embeds
├──arcane_learned_embeds.bin
├──ghibli_learned_embeds.bin
├──gta_learned_embeds.bin
├──kaya_learned_embeds.bin
├──manga_learned_embeds.bin
├──sims_learned_embeds.bin
└──uzumaki_learned_embeds.bin
-
FastAPI Option
Follow the code here, it should launch a server in your localhost with some port. Head over to "change-your-style" page and use the Gradio interface. Sample:
localhost:8000/change-your-style
-
Hugging Face Spaces Option
Head over to Change-Your-Style and interact with the Gradio interface. This is much easier and doesn't require you to download any heavy models. The caveat is that it runs on a space that uses a CPU only (which means inference is super slow!)
- Stable Diffusion Hugging Face Model Card
- Stable Diffusion Deep Dive by John O. Whitaker
- Stable Diffusion Concepts Library
- Hugging Face Stable Diffusion Notebook
Dahir Ibrahim (Deedax Inc) - http://instagram.com/deedax_inc
Email - suhayrid@gmail.com
YouTube - https://www.youtube.com/@deedaxinc.3389
Twitter - https://twitter.com/DeedaxInc
Project Link - https://github.com/Daheer/Change-Your-Style