Coder Social home page Coder Social logo

controlgif's Introduction

controlGIF

[Image2Video] Animate a given image with animatediff and controlnet

Animation

Above is a video demo link, please click to get a demo presentation.

Setup environment

conda create --name controlgif python=3.10
conda activate controlgif
conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.7 -c pytorch -c nvidia
# torch's version is 1.13.1 you can find other ways to install torch(cuda11.7) in https://pytorch.org/get-started/previous-versions/
pip install -r requirements.txt

Download checkpoints

  1. git clone the stable-diffusion-v1-5 from huggingface in ./checkpoints (format of diffusers, rather than a single .ckpt or .safetensors)
  2. download some personalized models from civitai (What I use most frequently is dreamshaper) in ./checkpoints/base_models
  3. download motion model from here in ./checkpoints/unet_temporal
  4. download controlnet model from here in ./checkpoints/controlnet

File structure example

- checkpoints
  - base_models
    - dreamshaper_8.safetensors
  - controlnet
    - controlnet_checkpoint.ckpt
  - stable-diffusion-v1-5
    - feature_extractor
    - safety_checker
    - scheduler
    - text_encoder
    - tokenizer
    - unet
    - vae
  - unet_temporal
    - motion_checkpoint_less_motion.ckpt
    - motion_checkpoint_more_motion.ckpt

Run the webui

conda activate controlgif
python app.py

I can run it in my RTX3090. If you erase the clip_interrogator module, you can run it in low VRAM like 16G or 12G.

Some notes

This method may lead to bad results when receive some portraits. (# in my TODO list)

And same method for SDXL version is under development , stay tuned!

Contact

If you have some questions, please open an issue or send an email to me at [email protected].

Acknowledgments

The code in this repository is derived from Animatediff and Diffusers.

controlgif's People

Contributors

crystallee-ai avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.