Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
shivamshrirao
GitHub Repository: shivamshrirao/diffusers
Path: blob/main/examples/imagic/README.md
1448 views

To further reduce VRAM usage, pass --gradient_checkpointing and --use_8bit_adam flag to use 8 bit adam optimizer from bitsandbytes.

Training takes around 11GB VRAM and 18-20 minutes on Tesla T4 in colab free tier.

Imagic Colab

Imagic training example

Imagic is a method for Text-Based Real Image editing with models like stable diffusion with just one image of a subject. The train_imagic.py script shows how to implement the training procedure and adapt it for stable diffusion.

Below are examples produced using the colab notebook.

Target TextInput ImageEdited Image
A photo of Barack Obama smiling with a big grin.ObamaObama
A bird spreading wingsBirdBird

TODO: Update README, Please refer to the colab notebook for example usage until then.

Imagic