Git Product home page Git Product logo

rg-lcd's Introduction

Reward Guided Latent Consistency Distillation

πŸ”₯News

  • (πŸ”₯New) 05/28/2024 We release the model weights and the local gradio demo! The model weights can be download from here. We will release other model weights soon!

  • 03/18/2024 Our repo for RG-LCD is created. We will release our codes and models very soon!! Please stay tuned!

🏭 Installation

pip install torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 diffusers transformers accelerate gradio webdataset accelerate open_clip_torch gradio==3.48.0 

βœ… Local gradio Demos (Text-to-Image):

Launch the gradio: (For MacOS users, need to set the device="mps" in app.py; For Intel GPU users, set device="xpu" in app.py)

python local_gradio/app.py --model_name MODEL_NAME

You can find the currently available models at here with the prefix RG-LCM. By default, MODEL_NAME is set to jiachenli-ucsb/RG-LCM-SD-2.1-768-HPSv2.1, which is ditilled from Stable Diffusion 2.1 with the reward feedback from HPSv2.1.

πŸ‹οΈ Training commands

To perform RG-LCD with the HPSv2.1, we can run

accelerate launch main.py --output_dir=PATH_TO_LOG \
 --gradient_checkpointing \
 --use_8bit_adam \
 --enable_xformers_memory_efficient_attention --resolution 768 \
 --train_shards_path_or_url "pipe:curl -L -s https://huggingface.co/datasets/laion/conceptual-captions-12m-webdataset/resolve/main/data/{00000..01090}.tar?download=true" \
 --optimize_reward_fn \
 --reward_fn_name hpsv2 \
 --direct_optim_expert_reward 
 --reward_scale 1

πŸ“ƒ Citation

@misc{li2024reward,
    title={Reward Guided Latent Consistency Distillation},
    author={Jiachen Li and Weixi Feng and Wenhu Chen and William Yang Wang},
    eprint={2403.11027},
    archivePrefix={arXiv},
    primaryClass={cs.CV}
}

rg-lcd's People

Stargazers

Yu Lei avatar Jinfa Huang avatar dkluffy avatar Zoey  avatar Jiachen Li avatar luyuhao avatar IronMan avatar CAI Zeyu avatar Weixi Feng avatar Tigeryang93 avatar Xing Fang  avatar  avatar  avatar

Watchers

 avatar Wu Yiming avatar Shon Xiao avatar Jiachen Li avatar IronMan 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.