Image-to-Image
Diffusers
ONNX
Safetensors
StableDiffusionXLInpaintPipeline
stable-diffusion-xl
inpainting
virtual try-on
Run this model with HF Jobs
Run ompatel245/IDM-VTON on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/ompatel245/IDM-VTON. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/ompatel245/IDM-VTON on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use ompatel245/IDM-VTON with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use ompatel245/IDM-VTON with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import AutoPipelineForInpainting from diffusers.utils import load_image # switch to "mps" for apple devices pipe = AutoPipelineForInpainting.from_pretrained("ompatel245/IDM-VTON", dtype=torch.float16, device_map="cuda") img_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" mask_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" image = load_image(img_url).resize((1024, 1024)) mask_image = load_image(mask_url).resize((1024, 1024)) prompt = "a tiger sitting on a park bench" generator = torch.Generator(device="cuda").manual_seed(0) image = pipe( prompt=prompt, image=image, mask_image=mask_image, guidance_scale=8.0, num_inference_steps=20, # steps between 15 and 30 work well for us strength=0.99, # make sure to use `strength` below 1.0 generator=generator, ).images[0] - Notebooks
- Google Colab
- Kaggle
Commit ·
58499d8
0
Parent(s):
Duplicate from yisol/IDM-VTON
Browse filesCo-authored-by: Yisol Choi <yisol@users.noreply.huggingface.co>
Files changed (30)
- .gitattributesAdded+37
- README.mdAdded+56
- assets/teaser.pngAdded
- assets/teaser2.pngAdded
- densepose/model_final_162be9.pklAdded+3
- humanparsing/parsing_atr.onnxAdded+3
- humanparsing/parsing_lip.onnxAdded+3
- image_encoder/config.jsonAdded+23
- image_encoder/model.safetensorsAdded+3
- model_index.jsonAdded+39
- openpose/ckpts/body_pose_model.pthAdded+3
- scheduler/scheduler_config.jsonAdded+19
- text_encoder/config.jsonAdded+25
- text_encoder/model.safetensorsAdded+3
- text_encoder_2/config.jsonAdded+25
- text_encoder_2/model.safetensorsAdded+3
- tokenizer/merges.txtAdded
- tokenizer/special_tokens_map.jsonAdded+24
- tokenizer/tokenizer_config.jsonAdded+33
- tokenizer/vocab.jsonAdded
- tokenizer_2/merges.txtAdded
- tokenizer_2/special_tokens_map.jsonAdded+24
- tokenizer_2/tokenizer_config.jsonAdded+33
- tokenizer_2/vocab.jsonAdded
- unet/config.jsonAdded+78
- unet/diffusion_pytorch_model.binAdded+3
- unet_encoder/config.jsonAdded+68
- unet_encoder/diffusion_pytorch_model.safetensorsAdded+3
- vae/config.jsonAdded+32
- vae/diffusion_pytorch_model.safetensorsAdded+3
12345678910111213141516171819202122232425262728293031323334353637*.7z filter=lfs diff=lfs merge=lfs -text*.arrow filter=lfs diff=lfs merge=lfs -text*.bin filter=lfs diff=lfs merge=lfs -text*.bz2 filter=lfs diff=lfs merge=lfs -text*.ckpt filter=lfs diff=lfs merge=lfs -text*.ftz filter=lfs diff=lfs merge=lfs -text*.gz filter=lfs diff=lfs merge=lfs -text*.h5 filter=lfs diff=lfs merge=lfs -text*.joblib filter=lfs diff=lfs merge=lfs -text*.lfs.* filter=lfs diff=lfs merge=lfs -text*.mlmodel filter=lfs diff=lfs merge=lfs -text*.model filter=lfs diff=lfs merge=lfs -text*.msgpack filter=lfs diff=lfs merge=lfs -text*.npy filter=lfs diff=lfs merge=lfs -text*.npz filter=lfs diff=lfs merge=lfs -text*.onnx filter=lfs diff=lfs merge=lfs -text*.ot filter=lfs diff=lfs merge=lfs -text*.parquet filter=lfs diff=lfs merge=lfs -text*.pb filter=lfs diff=lfs merge=lfs -text*.pickle filter=lfs diff=lfs merge=lfs -text*.pkl filter=lfs diff=lfs merge=lfs -text*.pt filter=lfs diff=lfs merge=lfs -text*.pth filter=lfs diff=lfs merge=lfs -text*.rar filter=lfs diff=lfs merge=lfs -text*.safetensors filter=lfs diff=lfs merge=lfs -textsaved_model/**/* filter=lfs diff=lfs merge=lfs -text*.tar.* filter=lfs diff=lfs merge=lfs -text*.tar filter=lfs diff=lfs merge=lfs -text*.tflite filter=lfs diff=lfs merge=lfs -text*.tgz filter=lfs diff=lfs merge=lfs -text*.wasm filter=lfs diff=lfs merge=lfs -text*.xz filter=lfs diff=lfs merge=lfs -text*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textassets/teaser.png filter=lfs diff=lfs merge=lfs -textassets/teaser2.png filter=lfs diff=lfs merge=lfs -text1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556---base_model: stable-diffusion-xl-1.0-inpainting-0.1tags: - stable-diffusion-xl - inpainting - virtual try-onlicense: cc-by-nc-sa-4.0---
# Check out more codes on our [github repository](https://github.com/yisol/IDM-VTON)!
# IDM-VTON : Improving Diffusion Models for Authentic Virtual Try-on in the WildThis is an official implementation of paper 'Improving Diffusion Models for Authentic Virtual Try-on in the Wild'- [paper](https://arxiv.org/abs/2403.05139) - [project page](https://idm-vton.github.io/)
🤗 Try our huggingface [Demo](https://huggingface.co/spaces/yisol/IDM-VTON)
 
## TODO LIST
- [x] demo model- [x] inference code- [ ] training code
## Acknowledgements
For the demo, GPUs are supported from [zerogpu](https://huggingface.co/zero-gpu-explorers), and auto masking generation codes are based on [OOTDiffusion](https://github.com/levihsu/OOTDiffusion) and [DCI-VTON](https://github.com/bcmi/DCI-VTON-Virtual-Try-On). Parts of the code are based on [IP-Adapter](https://github.com/tencent-ailab/IP-Adapter).
## Citation```@article{choi2024improving, title={Improving Diffusion Models for Virtual Try-on}, author={Choi, Yisol and Kwak, Sangkyung and Lee, Kyungmin and Choi, Hyungwon and Shin, Jinwoo}, journal={arXiv preprint arXiv:2403.05139}, year={2024}}```
## LicenseThe codes and checkpoints in this repository are under the [CC BY-NC-SA 4.0 license](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).
123version https://git-lfs.github.com/spec/v1oid sha256:b8a7382001b16e453bad95ca9dbc68ae8f2b839b304cf90eaf5c27fbdb4dae91size 255757821123version https://git-lfs.github.com/spec/v1oid sha256:04c7d1d070d0e0ae943d86b18cb5aaaea9e278d97462e9cfb270cbbe4cd977f4size 266859305123version https://git-lfs.github.com/spec/v1oid sha256:8436e1dae96e2601c373d1ace29c8f0978b16357d9038c17a8ba756cca376dbcsize 2668634111234567891011121314151617181920212223{ "_name_or_path": "./image_encoder", "architectures": [ "CLIPVisionModelWithProjection" ], "attention_dropout": 0.0, "dropout": 0.0, "hidden_act": "gelu", "hidden_size": 1280, "image_size": 224, "initializer_factor": 1.0, "initializer_range": 0.02, "intermediate_size": 5120, "layer_norm_eps": 1e-05, "model_type": "clip_vision_model", "num_attention_heads": 16, "num_channels": 3, "num_hidden_layers": 32, "patch_size": 14, "projection_dim": 1024, "torch_dtype": "float16", "transformers_version": "4.28.0.dev0"}123version https://git-lfs.github.com/spec/v1oid sha256:6ca9667da1ca9e0b0f75e46bb030f7e011f44f86cbfb8d5a36590fcd7507b030size 2528373448123456789101112131415161718192021222324252627282930313233343536373839{ "_class_name": "StableDiffusionXLInpaintPipeline", "_diffusers_version": "0.25.0", "_name_or_path": "stabilityai/stable-diffusion-xl-base-1.0", "force_zeros_for_empty_prompt": true, "requires_aesthetics_score": false, "scheduler": [ "diffusers", "DDPMScheduler" ], "text_encoder": [ "transformers", "CLIPTextModel" ], "feature_extractor": [ "transformers", "CLIPImageProcessor" ], "text_encoder_2": [ "transformers", "CLIPTextModelWithProjection" ], "tokenizer": [ "transformers", "CLIPTokenizer" ], "tokenizer_2": [ "transformers", "CLIPTokenizer" ], "unet": [ "diffusers", "UNet2DConditionModel" ], "vae": [ "diffusers", "AutoencoderKL" ]}123version https://git-lfs.github.com/spec/v1oid sha256:25a948c16078b0f08e236bda51a385d855ef4c153598947c28c0d47ed94bb746size 20926759512345678910111213141516171819{ "_class_name": "DDPMScheduler", "_diffusers_version": "0.21.0.dev0", "beta_end": 0.012, "beta_schedule": "scaled_linear", "beta_start": 0.00085, "clip_sample": false, "interpolation_type": "linear", "num_train_timesteps": 1000, "prediction_type": "epsilon", "sample_max_value": 1.0, "set_alpha_to_one": false, "skip_prk_steps": true, "steps_offset": 1, "timestep_spacing": "leading", "trained_betas": null, "use_karras_sigmas": false, "rescale_betas_zero_snr": true}12345678910111213141516171819202122232425{ "_name_or_path": "/home/suraj_huggingface_co/.cache/huggingface/hub/models--stabilityai--stable-diffusion-xl-base-1.0/snapshots/bf714989e22c57ddc1c453bf74dab4521acb81d8/text_encoder", "architectures": [ "CLIPTextModel" ], "attention_dropout": 0.0, "bos_token_id": 0, "dropout": 0.0, "eos_token_id": 2, "hidden_act": "quick_gelu", "hidden_size": 768, "initializer_factor": 1.0, "initializer_range": 0.02, "intermediate_size": 3072, "layer_norm_eps": 1e-05, "max_position_embeddings": 77, "model_type": "clip_text_model", "num_attention_heads": 12, "num_hidden_layers": 12, "pad_token_id": 1, "projection_dim": 768, "torch_dtype": "float16", "transformers_version": "4.29.2", "vocab_size": 49408}123version https://git-lfs.github.com/spec/v1oid sha256:79f531155c765c22c89e23328793a2e91a1178070af961c57e2eae5f0509b65bsize 49226587912345678910111213141516171819202122232425{ "_name_or_path": "/home/suraj_huggingface_co/.cache/huggingface/hub/models--stabilityai--stable-diffusion-xl-base-1.0/snapshots/bf714989e22c57ddc1c453bf74dab4521acb81d8/text_encoder_2", "architectures": [ "CLIPTextModelWithProjection" ], "attention_dropout": 0.0, "bos_token_id": 0, "dropout": 0.0, "eos_token_id": 2, "hidden_act": "gelu", "hidden_size": 1280, "initializer_factor": 1.0, "initializer_range": 0.02, "intermediate_size": 5120, "layer_norm_eps": 1e-05, "max_position_embeddings": 77, "model_type": "clip_text_model", "num_attention_heads": 20, "num_hidden_layers": 32, "pad_token_id": 1, "projection_dim": 1280, "torch_dtype": "float16", "transformers_version": "4.29.2", "vocab_size": 49408}123version https://git-lfs.github.com/spec/v1oid sha256:283bb90f987a133dec11947571aca17692ed32f3fff708441ac8eedcfa4a040esize 2778702976123456789101112131415161718192021222324{ "bos_token": { "content": "<|startoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "eos_token": { "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "pad_token": "<|endoftext|>", "unk_token": { "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }}123456789101112131415161718192021222324252627282930313233{ "add_prefix_space": false, "bos_token": { "__type": "AddedToken", "content": "<|startoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "clean_up_tokenization_spaces": true, "do_lower_case": true, "eos_token": { "__type": "AddedToken", "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "errors": "replace", "model_max_length": 77, "pad_token": "<|endoftext|>", "tokenizer_class": "CLIPTokenizer", "unk_token": { "__type": "AddedToken", "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }}123456789101112131415161718192021222324{ "bos_token": { "content": "<|startoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "eos_token": { "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "pad_token": "!", "unk_token": { "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }}123456789101112131415161718192021222324252627282930313233{ "add_prefix_space": false, "bos_token": { "__type": "AddedToken", "content": "<|startoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "clean_up_tokenization_spaces": true, "do_lower_case": true, "eos_token": { "__type": "AddedToken", "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "errors": "replace", "model_max_length": 77, "pad_token": "!", "tokenizer_class": "CLIPTokenizer", "unk_token": { "__type": "AddedToken", "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778{ "_class_name": "UNet2DConditionModel", "_diffusers_version": "0.25.0", "_name_or_path": "valhalla/sdxl-inpaint-ema", "act_fn": "silu", "addition_embed_type": "text_time", "addition_embed_type_num_heads": 64, "addition_time_embed_dim": 256, "attention_head_dim": [ 5, 10, 20 ], "attention_type": "default", "block_out_channels": [ 320, 640, 1280 ], "center_input_sample": false, "class_embed_type": null, "class_embeddings_concat": false, "conv_in_kernel": 3, "conv_out_kernel": 3, "cross_attention_dim": 2048, "cross_attention_norm": null, "decay": 0.9999, "down_block_types": [ "DownBlock2D", "CrossAttnDownBlock2D", "CrossAttnDownBlock2D" ], "downsample_padding": 1, "dual_cross_attention": false, "encoder_hid_dim": 1280, "encoder_hid_dim_type": "ip_image_proj", "flip_sin_to_cos": true, "freq_shift": 0, "in_channels": 13, "inv_gamma": 1.0, "layers_per_block": 2, "mid_block_only_cross_attention": null, "mid_block_scale_factor": 1, "mid_block_type": "UNetMidBlock2DCrossAttn", "min_decay": 0.0, "norm_eps": 1e-05, "norm_num_groups": 32, "num_attention_heads": null, "num_class_embeds": null, "only_cross_attention": false, "optimization_step": 37000, "out_channels": 4, "power": 0.6666666666666666, "projection_class_embeddings_input_dim": 2816, "resnet_out_scale_factor": 1.0, "resnet_skip_time_act": false, "resnet_time_scale_shift": "default", "sample_size": 128, "time_cond_proj_dim": null, "time_embedding_act_fn": null, "time_embedding_dim": null, "time_embedding_type": "positional", "timestep_post_act": null, "transformer_layers_per_block": [ 1, 2, 10 ], "up_block_types": [ "CrossAttnUpBlock2D", "CrossAttnUpBlock2D", "UpBlock2D" ], "upcast_attention": null, "update_after_step": 0, "use_ema_warmup": false, "use_linear_projection": true}123version https://git-lfs.github.com/spec/v1oid sha256:046b775cb9bbc67635fc3b148bb03bfe00496ce2f9ce8488a82fdb388669a521size 119657697741234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768{ "_class_name": "UNet2DConditionModel", "_diffusers_version": "0.19.0.dev0", "act_fn": "silu", "addition_embed_type_num_heads": 64, "addition_time_embed_dim": 256, "attention_head_dim": [ 5, 10, 20 ], "block_out_channels": [ 320, 640, 1280 ], "center_input_sample": false, "class_embed_type": null, "class_embeddings_concat": false, "conv_in_kernel": 3, "conv_out_kernel": 3, "cross_attention_dim": 2048, "cross_attention_norm": null, "down_block_types": [ "DownBlock2D", "CrossAttnDownBlock2D", "CrossAttnDownBlock2D" ], "downsample_padding": 1, "dual_cross_attention": false, "encoder_hid_dim": null, "encoder_hid_dim_type": null, "flip_sin_to_cos": true, "freq_shift": 0, "in_channels": 4, "layers_per_block": 2, "mid_block_only_cross_attention": null, "mid_block_scale_factor": 1, "mid_block_type": "UNetMidBlock2DCrossAttn", "norm_eps": 1e-05, "norm_num_groups": 32, "num_attention_heads": null, "num_class_embeds": null, "only_cross_attention": false, "out_channels": 4, "projection_class_embeddings_input_dim": 2816, "resnet_out_scale_factor": 1.0, "resnet_skip_time_act": false, "resnet_time_scale_shift": "default", "sample_size": 128, "time_cond_proj_dim": null, "time_embedding_act_fn": null, "time_embedding_dim": null, "time_embedding_type": "positional", "timestep_post_act": null, "transformer_layers_per_block": [ 1, 2, 10 ], "up_block_types": [ "CrossAttnUpBlock2D", "CrossAttnUpBlock2D", "UpBlock2D" ], "upcast_attention": null, "use_linear_projection": true}123version https://git-lfs.github.com/spec/v1oid sha256:357650fbfb3c7b4d94c1f5fd7664da819ad1ff5a839430484b4ec422d03f710asize 102700777361234567891011121314151617181920212223242526272829303132{ "_class_name": "AutoencoderKL", "_diffusers_version": "0.21.0.dev0", "_name_or_path": "madebyollin/sdxl-vae-fp16-fix", "act_fn": "silu", "block_out_channels": [ 128, 256, 512, 512 ], "down_block_types": [ "DownEncoderBlock2D", "DownEncoderBlock2D", "DownEncoderBlock2D", "DownEncoderBlock2D" ], "force_upcast": false, "in_channels": 3, "latent_channels": 4, "layers_per_block": 2, "norm_num_groups": 32, "out_channels": 3, "sample_size": 512, "scaling_factor": 0.13025, "up_block_types": [ "UpDecoderBlock2D", "UpDecoderBlock2D", "UpDecoderBlock2D", "UpDecoderBlock2D" ]}123version https://git-lfs.github.com/spec/v1oid sha256:98a14dc6fe8d71c83576f135a87c61a16561c9c080abba418d2cc976ee034f88size 334643268.gitattributesAdded+37
README.mdAdded+56
assets/teaser.pngAdded

Large File Pointer Details
- SHA256: e0ff5c96023ddf67864dc49acde2fab6a0c982fd77aa4979d9a2e77f45ad0b82
- Pointer size: 132 Bytes
- Size of remote file: 7.06 MB
assets/teaser2.pngAdded

Large File Pointer Details
- SHA256: 4a2c3522cb7805407f437f1639418166477f334cbef739e06947b5dfc68a1968
- Pointer size: 132 Bytes
- Size of remote file: 9.02 MB
densepose/model_final_162be9.pklAdded+3
humanparsing/parsing_atr.onnxAdded+3
humanparsing/parsing_lip.onnxAdded+3
image_encoder/config.jsonAdded+23
image_encoder/model.safetensorsAdded+3
model_index.jsonAdded+39
openpose/ckpts/body_pose_model.pthAdded+3
scheduler/scheduler_config.jsonAdded+19
text_encoder/config.jsonAdded+25
text_encoder/model.safetensorsAdded+3
text_encoder_2/config.jsonAdded+25
text_encoder_2/model.safetensorsAdded+3
tokenizer/merges.txtAdded
tokenizer/special_tokens_map.jsonAdded+24
tokenizer/tokenizer_config.jsonAdded+33
tokenizer/vocab.jsonAdded
tokenizer_2/merges.txtAdded
tokenizer_2/special_tokens_map.jsonAdded+24
tokenizer_2/tokenizer_config.jsonAdded+33
tokenizer_2/vocab.jsonAdded
unet/config.jsonAdded+78
unet/diffusion_pytorch_model.binAdded+3
unet_encoder/config.jsonAdded+68
unet_encoder/diffusion_pytorch_model.safetensorsAdded+3
vae/config.jsonAdded+32
vae/diffusion_pytorch_model.safetensorsAdded+3