https://github.com/bytedance/res-adapter
[AAAI 2025] Official codes of "ResAdapter: Domain Consistent Resolution Adapter for Diffusion Models".
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.1%) to scientific vocabulary
Repository
[AAAI 2025] Official codes of "ResAdapter: Domain Consistent Resolution Adapter for Diffusion Models".
Basic Info
- Host: GitHub
- Owner: bytedance
- License: apache-2.0
- Language: Python
- Default Branch: main
- Homepage: https://res-adapter.github.io/
- Size: 203 MB
Statistics
- Stars: 753
- Watchers: 18
- Forks: 25
- Open Issues: 8
- Releases: 0
Metadata Files
README.md
ResAdapter: Domain Consistent Resolution Adapter for Diffusion Models
Jiaxiang Cheng, Pan Xie*, Xin Xia, Jiashi Li, Jie Wu, Yuxi Ren, Huixia Li, Xuefeng Xiao, Min Zheng, Lean Fu (*Corresponding author) ByteDance Inc. ⭐ If ResAdapter is helpful to your images or projects, please help star this repo. Thanks! 🤗
Comparison examples between resadapter and [dreamlike-diffusion-1.0](https://civitai.com/models/1274/dreamlike-diffusion-10).
Release
[2024/12/10]🎉 ResAdapter is accepted by AAAI 2025.[2024/04/07]🔥 We release the official gradio space in Huggingface.[2024/04/05]🔥 We release the resadapter_v2 weights.[2024/03/30]🔥 We release the ComfyUI-ResAdapter.[2024/03/28]🔥 We release the resadapter_v1 weights.[2024/03/04]🔥 We release the arxiv paper. <!-- -[2024/03/12]Code: 🔥 we release the inference code. -->
Quicktour
We provide a standalone example code to help you quickly use resadapter with diffusion models.
Comparison examples (640x384) between resadapter and [dreamshaper-xl-1.0](https://huggingface.co/Lykon/dreamshaper-xl-1-0). Top: with resadapter. Bottom: without resadapter.
```python
pip install diffusers, transformers, accelerate, safetensors, huggingface_hub
import torch from torchvision.utils import saveimage from safetensors.torch import loadfile from huggingfacehub import hfhub_download from diffusers import AutoPipelineForText2Image, DPMSolverMultistepScheduler
generator = torch.manual_seed(0) prompt = "portrait photo of muscular bearded guy in a worn mech suit, light bokeh, intricate, steel metal, elegant, sharp focus, soft lighting, vibrant colors" width, height = 640, 384
Load baseline pipe
modelname = "lykon-models/dreamshaper-xl-1-0" pipe = AutoPipelineForText2Image.frompretrained(modelname, torchdtype=torch.float16, variant="fp16").to("cuda") pipe.scheduler = DPMSolverMultistepScheduler.fromconfig(pipe.scheduler.config, usekarrassigmas=True, algorithmtype="sde-dpmsolver++")
Inference baseline pipe
image = pipe(prompt, width=width, height=height, numinferencesteps=25, numimagesperprompt=4, outputtype="pt").images saveimage(image, f"imagebaseline.png", normalize=True, padding=0)
Load resadapter for baseline
resadaptermodelname = "resadapterv1sdxl" pipe.loadloraweights( hfhubdownload(repoid="jiaxiangc/res-adapter", subfolder=resadaptermodelname, filename="pytorchloraweights.safetensors"), adaptername="resadapter", ) # load lora weights pipe.setadapters(["resadapter"], adapterweights=[1.0]) pipe.unet.loadstatedict( loadfile(hfhubdownload(repoid="jiaxiangc/res-adapter", subfolder=resadaptermodelname, filename="diffusionpytorchmodel.safetensors")), strict=False, ) # load norm weights
Inference resadapter pipe
image = pipe(prompt, width=width, height=height, numinferencesteps=25, numimagesperprompt=4, outputtype="pt").images saveimage(image, f"imageresadapter.png", normalize=True, padding=0) ```
Download
Models
We have released all resadapter weights, you can download resadapter models from Huggingface. The following is our resadapter model card:
|Models | Parameters | Resolution Range | Ratio Range | Links | | --- | --- |--- | --- | --- | |resadapterv2sd1.5| 0.9M | 128 <= x <= 1024 | 0.28 <= r <= 3.5 | Download| |resadapterv2sdxl| 0.5M | 256 <= x <= 1536 | 0.28 <= r <= 3.5 | Download| |resadapterv1sd1.5| 0.9M | 128 <= x <= 1024 | 0.5 <= r <= 2 | Download| |resadapterv1sd1.5extrapolation| 0.9M | 512 <= x <= 1024 | 0.5 <= r <= 2 | Download| |resadapterv1sd1.5interpolation| 0.9M | 128 <= x <= 512 | 0.5 <= r <= 2 | Download| |resadapterv1sdxl| 0.5M | 256 <= x <= 1536 | 0.5 <= r <= 2 | Download | |resadapterv1sdxlextrapolation| 0.5M | 1024 <= x <= 1536 | 0.5 <= r <= 2 | Download | |resadapterv1sdxlinterpolation| 0.5M | 256 <= x <= 1024 | 0.5 <= r <= 2 | Download |
Hint1: We update the resadapter name format according to controlnet.
Hint2: If you want use resadapter with personalized diffusion models, you should download them from CivitAI.
Hint3: If you want use resadapter with ip-adapter, controlnet and lcm-lora, you should download them from Huggingface.
Hint4: Here is an installation guidance for preparing environment and downloading models.
Inference
If you want generate images in our inference script, you should install dependency libraries and download related models according to installation guidance. After filling in example configs, you can directly run this script.
bash
python main.py --config /path/to/file
ResAdapter with Personalized Models for Text to Image






Comparison examples (960x1104) between resadapter and [dreamshaper-7](https://civitai.com/models/1274/dreamlike-diffusion-10). Top: with resadapter. Bottom: without resadapter.
ResAdapter with ControlNet for Image to Image








Comparison examples (840x1264) between resadapter and [lllyasviel/sd-controlnet-canny](https://huggingface.co/lllyasviel/sd-controlnet-canny). Top: with resadapter, bottom: without resadapter.
ResAdapter with ControlNet-XL for Image to Image








Comparison examples (336x504) between resadapter and [diffusers/controlnet-canny-sdxl-1.0](https://huggingface.co/diffusers/controlnet-canny-sdxl-1.0). Top: with resadapter, bottom: without resadapter.
ResAdapter with IP-Adapter for Face Variance








Comparison examples (864x1024) between resadapter and [h94/IP-Adapter](https://huggingface.co/h94/IP-Adapter). Top: with resadapter, bottom: without resadapter.
ResAdapter with LCM-LoRA for Speeding up








Comparison examples (512x512) between resadapter and [dreamshaper-xl-1.0](https://huggingface.co/Lykon/dreamshaper-xl-1-0) with [lcm-sdxl-lora](https://huggingface.co/latent-consistency/lcm-lora-sdxl). Top: with resadapter, bottom: without resadapter.
Community Resource
Gradio
- Replicate website: bytedance/res-adapter by (@Chenxi)
- Huggingface space:
- jiaxiangc/res-adapter (official space)
- ameerazam08/Res-Adapter-GPU-Demo by (@Ameer Azam)
An text-to-image example about res-adapter in huggingface space. More information in jiaxiangc/res-adapter.

ComfyUI
- jiaxiangc/ComfyUI-ResAdapter (official comfyui node)
- blepping/ComfyUI-ApplyResAdapterUnet by (@blepping)
An text-to image example about ComfyUI-ResAdapter. More examples about lcm-lora, controlnet and ipadapter can be found in ComfyUI-ResAdapter.
https://github.com/jiaxiangc/ComfyUI-ResAdapter/assets/162297627/82453931-23de-4f72-8a9c-1053c4c8d81a
WebUI
I am learning how to make webui extension.
Local Gradio Demo
Run the following script:
```bash
pip install peft, gradio, httpx==0.23.3
python app.py ```
Usage Tips
- If you are not satisfied with interpolation images, try to increase the alpha of resadapter to 1.0.
- If you are not satisfied with extrapolate images, try to choose the alpha of resadapter in 0.3 ~ 0.7.
- If you find the images with style conflicts, try to decrease the alpha of resadapter.
- If you find resadapter is not compatible with other accelerate lora, try to decrease the alpha of resadapter to 0.5 ~ 0.7.
Acknowledgements
- ResAdapter is developed by AutoML Team at ByteDance Inc, all copyright reserved.
- Thanks to the HuggingFace gradio team for their free GPU support!
- Thanks to the IP-Adapter, ControlNet, LCM-LoRA for their nice work.
- Thank @Chenxi and @AMEERAZAM08 to provide gradio demos.
- Thank @fengyuzzz to support video demos in ComfyUI-ResAdapter.
Star History
Citation
If you find ResAdapter useful for your research and applications, please cite us using this BibTeX:
@inproceedings{cheng2025resadapter,
title={Resadapter: Domain consistent resolution adapter for diffusion models},
author={Cheng, Jiaxiang and Xie, Pan and Xia, Xin and Li, Jiashi and Wu, Jie and Ren, Yuxi and Li, Huixia and Xiao, Xuefeng and Wen, Shilei and Fu, Lean},
booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
volume={39},
number={3},
pages={2438--2446},
year={2025}
}
For any question, please feel free to contact us via jiaxiangcc@gmail.com or xiepan.01@bytedance.com.
Owner
- Name: Bytedance Inc.
- Login: bytedance
- Kind: organization
- Location: Singapore
- Website: https://opensource.bytedance.com
- Twitter: ByteDanceOSS
- Repositories: 255
- Profile: https://github.com/bytedance
GitHub Events
Total
- Issues event: 4
- Watch event: 33
- Push event: 2
- Fork event: 3
Last Year
- Issues event: 4
- Watch event: 33
- Push event: 2
- Fork event: 3
Committers
Last synced: about 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| chengjiaxiang | c****g@b****m | 76 |
| chenxwh | c****e@g****m | 3 |
| fengyuzzz | 1****z | 2 |
| zweifisch | z****l@g****m | 1 |
| Ameer Azam | a****8@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: about 1 year ago
All Time
- Total issues: 20
- Total pull requests: 8
- Average time to close issues: about 1 month
- Average time to close pull requests: 2 days
- Total issue authors: 17
- Total pull request authors: 4
- Average comments per issue: 2.85
- Average comments per pull request: 0.63
- Merged pull requests: 7
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 4
- Pull requests: 0
- Average time to close issues: 15 days
- Average time to close pull requests: N/A
- Issue authors: 4
- Pull request authors: 0
- Average comments per issue: 1.75
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- CXNing (3)
- AlexFeYang (1)
- madeirafranciscoluxio (1)
- VimukthiRandika1997 (1)
- wudideasdf (1)
- 175Roy (1)
- zoenders (1)
- andupotorac (1)
- zcai0612 (1)
- liushanyuan18 (1)
- clg0803 (1)
- jeantimex (1)
- yxt132 (1)
- taylor2nerf (1)
- Petermotoo (1)
Pull Request Authors
- AMEERAZAM08 (4)
- chenxwh (4)
- zweifisch (2)
- fengyuzzz (2)