Code Monkey home page Code Monkey logo

open-replaceanything's Introduction

Unofficial Implementation of ReplaceAnything

If you find this repository helpful, please consider giving us a star⭐!

We only train on a toy datasets for debug, and it is difficult to achieve official results under the condition of insufficient data scale and quality. Because of the consideration of time and cost, we do not intend to collect and filter a large number of high-quality data. If someone has a robust model trained on a large amount of high-quality data and is willing to share it, make a pull request.

If anyone is willing to provide high-quality data, do not hesitate to contact me.

Overview

This repository contains an simple and unofficial implementation of ReplaceAnything. This project is built upon Diffusers and BrushNet. This implementation is developed by Dongxu Yue.

🚀 Getting Started

Environment Requirement 🌍

BrushNet has been implemented and tested on Pytorch 1.12.1 with python 3.9.

Clone the repo:

git clone https://github.com/dongxuyue/Open-ReplaceAnything.git

We recommend you first use conda to create virtual environment, and install pytorch following official instructions. For example:

conda create -n diffusers python=3.9 -y
conda activate diffusers
python -m pip install --upgrade pip
pip install torch==1.12.1+cu116 torchvision==0.13.1+cu116 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu116

Then, you can install diffusers (implemented in this repo) with:

pip install -e .

After that, you can install required packages thourgh:

cd examples/replace_anything/
pip install -r requirements.txt

🏃🏼 Training

Stage 1

Stage 1 involves fine-tuning a basic Stable Diffusion U-Net to enhance its character generation capabilities and aesthetics. You can use existing models on Civitai instead of training from scratch. You can train Stage 1 with:

cd examples/replace_anything/
bash train_stage_1.sh

You can replace the pretrained SD checkpoints with your own in train_stage_1.sh and modify the data path.

Stage 2

Stage 2 involves training two conditional branches to control the base model trained in Stage 1. Note that you will need paired data (image, text, pose, canny, object) for this training. You can train Stage 2 with:

cd examples/replace_anything/
bash train_stage_2.sh

ToDo

  • Release Training Code.
  • Release Inference Code.
  • Release Unofficial Pre-trained Weights.
  • Release Gradio Demo.

Acknowledgements

Special thanks to the original authors of the ReplaceAnything project and the for their foundational work that inspired this unofficial implementation.

Email

If you have any questions, do not hesitate to contact: [email protected]

open-replaceanything's People

Contributors

dongxuyue avatar

Stargazers

Allan avatar zhifeng avatar  avatar Jiaxing Chen avatar 雷多狗子 avatar 夏の森 avatar Lizhan Xiong avatar Pony Su avatar Steven Kun avatar 哈泽和它的朋友圈 avatar 人工智能达人 avatar 你男朋友技术不错 avatar Xavier 黎 avatar 享福报的程序员 avatar Kenzo Tagami avatar 码工小谷 avatar Thomas Taiko avatar 数鲸小分队 avatar ⅔ avatar 賢者タイム avatar Sierra Guo avatar Sator² avatar 画画的北北 avatar  avatar 正和岛岛主 avatar Sebastian Ma avatar Execute() avatar Vespoli avatar ねね avatar Mu Nan (木南) avatar 刘贵州 avatar Chao Dong avatar 潘晨光 avatar 共赴前程 avatar メイメイ avatar Tommy Yip avatar Rin Ozawa avatar Dillon Mo avatar - Kai - avatar La High avatar 奇妙な冒険 avatar Wang Heye avatar Zhaohui Zhu avatar 云深数字人 avatar 蔡车陂 Indie Fans avatar Lovely Dragon avatar Phuan Tu avatar Lixin Yuan avatar Suzhou Blue Water avatar Bo Sin avatar Kevin Gao avatar 汪菲鸿 avatar Yummy Cha avatar Leo Wei avatar 阿奈斯台辛 avatar 妄想之夏 avatar 海王·鑫 avatar Xuefeng Xiao avatar 李小秋 avatar Barreleye avatar Ms. Manner avatar 科学边界技术援助团队 avatar  avatar 钱田飞 avatar 曹文武 avatar 唐施主 avatar Lora Chu avatar Hinata avatar Jiaxuan You avatar 怒喵喵 avatar Melissa Quinlan avatar 当时不寻常 avatar 张海庚 avatar Dumetolisa Nebeuwa avatar Billy Xi avatar Serge Martel avatar 谭宏闻 avatar Hang Zhang (张航) avatar  avatar Dulé Ge avatar 焦糖马里奥 avatar Mingming Chen avatar I'm Javon Marks avatar Wentao Tsao avatar Vega Fang avatar Nannan Rong avatar Quinto Park avatar ZNA avatar himoda chan avatar Yuan Yang avatar Hailong Gong avatar FR Chi avatar Polaris Kai avatar Alchemist avatar Life is Flow avatar 姚晓俊 avatar The Ball Manager avatar Antonio Fang avatar Orbitz::{} avatar 码畜朵小姐 avatar

Watchers

imperator avatar  avatar Johnny Chew avatar Kamifer Burns avatar Ray Musk avatar Botao Du avatar 无溯·曾 avatar Bart's Lab avatar Leon Zhu avatar Tianqi Cheung avatar Wu Wu avatar 蒋甜甜 avatar Alan Yang avatar Yilia Ye avatar Steele Koch avatar Alex Yi avatar 王力没有红 avatar Lisa Wu avatar 张老师 avatar Miss. Wu avatar Xiao² Duan avatar 张思绮 avatar 唐守义 avatar 庞志尧 avatar 罗哲 avatar 沢庵 avatar Weihan·Cao avatar 代码少女心 avatar 张剑豪 avatar 星空 x 死宅 avatar 梁俊宇 avatar Leo Pan avatar Ruixi Fan avatar Hao Shang avatar Zen Obsidian avatar  avatar 涂娜娜 avatar 马志宇 avatar 魔鬼·珺 avatar Farming Tong avatar ドーム avatar Benjamin Moll avatar Jayden Gottlieb avatar 筱楽 avatar 両角凛 avatar Ashley En avatar Guo Lin avatar 热心市民黄先生 avatar 虞兮曦 avatar Keo avatar Nowwa avatar Unprocessable Man avatar Hồ Thi Tý avatar Vicki Cheung avatar Jason Sung avatar Margaret Wong avatar 卢贤恒 avatar 轻茹莉莉酱 avatar 李易连 avatar 霎弼海龍 avatar DELAG avatar Awesome King avatar Xuper avatar Nicholas Baird avatar NaN Smarter avatar Not Fatal Error Yet avatar ABSOLUTELY WONDERFUL avatar James H. Park avatar Norah Disc avatar No.67 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.