Skip to content

Change-Your-Style combines the Image2Image and Textual Inversion to change the style of input images.

License

Notifications You must be signed in to change notification settings

Daheer/Change-Your-Style

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Change-Your-Style

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.

Model Architecture

Stable Diffusion

Diagram from here

Textual Inversion

Diagram from here

Built Using

Prerequisites and Installation

  • 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

Project Structure

│   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

Usage

  • 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!)

Demo

Arcane Concept

GTA 5 Concept

Kaya Ghost Assasin Concept

Sims 2 Concept

References

Contact

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

About

Change-Your-Style combines the Image2Image and Textual Inversion to change the style of input images.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published