Giter Club home page Giter Club logo

mimicbrush's Introduction

带参考模仿的零样本图像编辑

陈曦 · 冯雨桐 · 陈梦婷 · 王一阳 · 张世龙 · 刘宇 · 沈玉君 · 赵恒双 香港大学 |阿里巴巴集团 |蚂蚁集团

论文 PDF 项目页面

消息

  • [2024.06.12]发布推理代码,本地gradio demo,在线demo。
  • [Todo]发布我们的基准。

社区贡献

@AIFSH提供的ComfyUI 版本

安装

安装方式conda

conda env create -f environment.yaml
conda activate mimicbrush

或者pip

#Python==3.8.5
pip install -r requirements.txt

下载检查点

下载 SD-1.5 和 SD-1.5-inpainting 检查点:

下载 MimicBrush 检查点以及 VAE、CLIP 编码器和深度模型

您可以使用以下代码从 modelscope 下载它们

from modelscope.hub.snapshot_download import snapshot_download as ms_snapshot_download

sd_dir = ms_snapshot_download('xichen/cleansd', cache_dir='./modelscope') print('=== Pretrained SD weights downloaded ===') model_dir = ms_snapshot_download('xichen/MimicBrush', cache_dir='./modelscope') print('=== MimicBrush weights downloaded ===')

<clipboard-copy aria-label="Copy" class="ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 tooltipped-no-delay d-flex flex-justify-center flex-items-center" data-copy-feedback="Copied!" data-tooltip-direction="w" value="from modelscope.hub.snapshot_download import snapshot_download as ms_snapshot_download

sd_dir = ms_snapshot_download('xichen/cleansd', cache_dir='./modelscope') print('=== Pretrained SD weights downloaded ===') model_dir = ms_snapshot_download('xichen/MimicBrush', cache_dir='./modelscope') print('=== MimicBrush weights downloaded ===')" tabindex="0" role="button">

或来自 Huggingface

from huggingface_hub import snapshot_download
snapshot_download(repo_id="xichenhku/cleansd", local_dir="./cleansd")
print('=== Pretrained SD weights downloaded ===')
snapshot_download(repo_id="xichenhku/MimicBrush", local_dir="./MimicBrush")
print('=== MimicBrush weights downloaded ===')

Gradio 演示

首先修改./configs/inference.yaml设置模型权重的路径,然后运行脚本:

python run_gradio3_demo.py

gradio 演示看起来像下面显示的 UI。

*如果您想要像第三种情况那样进行管道纹理转移,请不要忘记点击“保持原始形状”。

简要教程:

  • 上传/选择要编辑的源图像。
  • 在源图像上绘制要编辑的区域。
  • 上传/选择参考图像。
  • 跑步。

推理

  1. 在 Google Drive 下载我们的评估基准:

    • 网址:[待发布]
  2. 设置每个数据集和检查点的路径./config/inference.yaml

  3. 使用以下方式运行推理

    python run_inference_benchmark.py

致谢

该项目是在IP-AdapterMagicAnimate的代码库上开发的 。我们感谢这项伟大的工作!

引用

如果您发现该代码库对您的研究有用,请使用以下条目。

@article{chen2024mimicbrush,
  title={Zero-shot Image Editing with Reference Imitation},
  author={Chen, Xi and Feng, Yutong and Chen, Mengting and Wang, Yiyang, and Zhang, Shilong and Yu, Liu and Shen, Yujun and Zhao, Hengshuang},
  journal={arXiv preprint arXiv:2406.07547},
  year={2024}
}

星历史

星历史图

mimicbrush's People

Contributors

xavierchen34 avatar yuanzhongqiao 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.