Home

Awesome

See my custom models at https://ntcai.xys and https://civitai.com/user/ntc

Based on 'Erasing Concepts from Diffusion Models' https://erasing.baulab.info

ConceptMod

Finetuning with words.

Allows manipulation of Stable Diffusion with it's own learned representations.

Example: 'vibrant colors++|boring--'

Will erase boring concept and exaggerate vibrant colors concept.

New - train or animate on runpod

Usage examples and training phrases available on civit:

https://civitai.com/tag/conceptmod?sort=Newest

New! Use conceptmod easily:

animate any lora: https://runpod.io/gsc?template=gp2czwaknt&ref=xf9c949d

train on a phrase: https://runpod.io/gsc?template=8y3jhbola2&ref=xf9c949d

See the readme on runpod for details on how to use these. Tag it with conceptmod if you release on civit.ai.

Concept modifications

  f"{target}++:{2 * lambda_value}",
  f"{prefix}={target}:{4 * lambda_value}",
  f"{target}%{prefix}:-{lambda_value}"

lambda_value default is 0.1

Example:

"final boss++:0.4|final boss%{random_prompt}:-0.1"

experimental

Prompt options

Installation Guide

If you launched with runpad or the docker image (ntcai/conceptmod_train), skip to training as this is already done.

Dependencies

From https://civitai.com/user/Envy

Working on windows.

conda create --name conceptmod python=3.10
conda activate conceptmod
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
pip install pytorch_lightning==1.7.7
pip install omegaconf einops scipy scikit-image scikit-learn lmdb
pip install taming-transformers-rom1504 'git+https://github.com/openai/CLIP.git@main#egg=clip' image-reward safetensors datasets matplotlib diffusers kornia
conda install huggingface_hub

This assumes you've got a working anaconda environment set up.

Dependency issues

Please see this dockerfile for the list of dependencies you need:

https://github.com/ntc-ai/conceptmod/blob/main/docker/Dockerfile_train

Look for the pip install and python3 setup.py develop sections. Extracting a Lora from a checkpoint has different dependencies.

Training Guide

Checkout train_sequential.sh for an example.

Generating Images

To generate images from one of the custom models use the following instructions:

Notes

mod_count is set to two conceptmods being trained in parallel. You can reduce it if needed. negative_guidance, start_guidance which are positive in the original repository, is negative in this one. See train_sequential.sh for usage example.

Citing our work

Cite the original, maybe gpt-4