Home Artists Posts Import Register

Downloads

Content

Patreon exclusive posts index

Join discord to get help, chat, discuss and also tell me your discord username to get your special rank : SECourses Discord

IDM-VTON: Improving Diffusion Models for Authentic Virtual Try-on in the Wild

The model is extremely flexible and robust so you can make very funny images :)

Full how to use and install tutorial published : https://youtu.be/m4pcIeAVQD0

29 May 2024 Update

  • Libraries and installers updated to newest version

  • Download latest installer virtual_try_on_v11.zip

  • Tested on Windows, Massed Compute and RunPod, all working perfect

  • If you get error do a fresh install and send me install CMD logs

18 May 2024 Update

  • Gradio version upgraded to latest and that editing requirement bug fixed

  • Example images directly working

  • To update to this version you can delete venv and reinstall

  • Or activate venv and execute pip install gradio --upgrade

12 May 2024 Update

  • 3 Auto mask categories added : upper_body, lower_body and dresses

  • If you had V6 installed just run Windows_Update .bat file and it should work

  • Example picture : elon musk in a dress.png

3 May 2024 Update

30 April 2024 Update

  • Randomize Seed added

  • Missing library bug fixed for RunPod and Massed Compute

28 April 2024 Update

  • Updated to V5

  • Full how to use and install tutorial published : https://youtu.be/m4pcIeAVQD0

  • Please upvote this reddit thread and leave a good reply if you can :

  • Please do a fresh reinstall - models won't be downloaded again

  • Kaggle free notebook is now working - please read the Kaggle instructions in the notebook

  • Now supports CPU offloading and also FP8 and FP4

  • With newest improvements, you can use VTON even on 8 GB GPUs very well

  • Fastest high VRAM options are 1+1 and lowest VRAM options are 2+3

  • VRAM usages are as below

27 April 2024 Update

  • Updated to V4

  • Currently we are working on FP8 version + CPU offloading to reduce VRAM usage significantly

  • Thus a working free Kaggle notebook will be hopefully possible 

  • Just double click and run Windows_Update .bat file to update. No need to reinstall

  • Number of images to generate feature added. This is super useful since each seed makes huge difference and thus you can get amazing pictures with generating more images at once with different seeds

  • It will start using your entered seed and increment it by 1 for every image you generate with number of images to generate

  • When saving image files, the seed will be appended to the name of the file now

  • Workflows and examples posted on Reddit please also consider to upvote. Link below

  • https://www.reddit.com/r/StableDiffusion/comments/1ce2iax/idmvton_virtual_tryon_is_just_another_level/

26 April 2024 Update

  • Massed Compute (31 cents per hour A6000 GPU works blazing fast and no errors) and also RunPod automatic installers and instructions added to the zip file

Requirements

  • For this to work make sure to have installed Python & Git. I am not sure but may require C++ tools as well

  • You can install Python, Git and C++ tools by looking at this tutorial : https://youtu.be/-NjNy7afOQ0

How To Install & Use

  • Extract attached virtual_try_on_v11.zip content into any folder

  • Don't make parent folder name same as IDM-VTON

  • Double click Windows_Install .bat file

  • After installation has been complete double click Windows_Start_VTON_app .bat file

  • When first time running it will download some models into Hugging Face cache folder

  • If your input image resolution and clothing resolution are not same you should enable auto crop resize which is enabled by default

  • Every generated image is saved automatically in outputs folder

  • Look how to use VTON.png to see how to use

Files

Comments

Tobe2d

When it finish installing iset images from the examples and click on Try-on but nothing is happining! what am I missing?

Furkan Gözükara

edit input image and hit again. where do you use windows runpod kaggle massed compute? did you watch both of the tutorials?

jonathan sanchez

hello friend, I want to know if you can enable a field for custom mask or do you think it will not improve the results?

Lưu Bá Tài

function 'cadam32bit_grad_fp32' not found Running on local URL: http://127.0.0.1:7860 To create a public link, set `share=True` in `launch()`. The config attributes {'decay': 0.9999, 'inv_gamma': 1.0, 'min_decay': 0.0, 'optimization_step': 37000, 'power': 0.6666666666666666, 'update_after_step': 0, 'use_ema_warmup': False} were passed to UNet2DConditionModel, but are not expected and will be ignored. Please verify your config.json configuration file. How to fix this error on windows 11 ?

Lưu Bá Tài

return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking) torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 26.00 MiB. GPU 0 has a total capacity of 11.76 GiB of which 22.88 MiB is free. Process 2019 has 104.12 MiB memory in use. Including non-PyTorch memory, this process has 11.06 GiB memory in use. Of the allocated memory 10.54 GiB is allocated by PyTorch, and 429.29 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables) I run on ubuntu 22.04.3 and got this error, do you know why?

Lưu Bá Tài

I'm Run V7 in Ubuntu get error: subset = pose['bodies']['subset'][0][:18] IndexError: list index out of range

weilong guo

how to fix it ?

weilong guo

when i use load_mode 4bit ,get error : Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/gradio/queueing.py", line 528, in process_events response = await route_utils.call_process_api( File "/usr/local/lib/python3.10/dist-packages/gradio/route_utils.py", line 270, in call_process_api output = await app.get_blocks().process_api( File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1908, in process_api result = await self.call_function( File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1485, in call_function prediction = await anyio.to_thread.run_sync( File "/usr/local/lib/python3.10/dist-packages/anyio/to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 807, in run result = context.run(func, *args) File "/usr/local/lib/python3.10/dist-packages/gradio/utils.py", line 808, in wrapper response = f(*args, **kwargs) File "/export/App/training_platform/PinoModel/yisol/idm-server/app_VTON.py", line 239, in start_tryon ) = pipe.encode_prompt( File "/export/App/training_platform/PinoModel/yisol/idm-server/src/tryon_pipeline.py", line 634, in encode_prompt prompt_embeds = text_encoder(text_input_ids.to(device), output_hidden_states=True) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1541, in _call_impl return forward_call(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/accelerate/hooks.py", line 165, in new_forward output = module._old_forward(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/transformers/models/clip/modeling_clip.py", line 804, in forward return self.text_model( File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1541, in _call_impl return forward_call(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/transformers/models/clip/modeling_clip.py", line 709, in forward encoder_outputs = self.encoder( File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1541, in _call_impl return forward_call(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/transformers/models/clip/modeling_clip.py", line 636, in forward layer_outputs = encoder_layer( File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1541, in _call_impl return forward_call(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/transformers/models/clip/modeling_clip.py", line 378, in forward hidden_states, attn_weights = self.self_attn( File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1541, in _call_impl return forward_call(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/transformers/models/clip/modeling_clip.py", line 267, in forward query_states = self.q_proj(hidden_states) * self.scale File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1541, in _call_impl return forward_call(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/bitsandbytes/nn/modules.py", line 256, in forward out = bnb.matmul_4bit(x, self.weight.t(), bias=bias, quant_state=self.weight.quant_state) File "/usr/local/lib/python3.10/dist-packages/bitsandbytes/autograd/_functions.py", line 577, in matmul_4bit return MatMul4Bit.apply(A, B, out, bias, quant_state) File "/usr/local/lib/python3.10/dist-packages/torch/autograd/function.py", line 598, in apply return super().apply(*args, **kwargs) # type: ignore[misc] File "/usr/local/lib/python3.10/dist-packages/bitsandbytes/autograd/_functions.py", line 516, in forward output = torch.nn.functional.linear(A, F.dequantize_4bit(B, quant_state).to(A.dtype).t(), bias) RuntimeError: mat1 and mat2 shapes cannot be multiplied (77x768 and 1x294912)

KARL EVEN

Hey, I wanted to reach out because I ran into a bit of an issue. I had your script running perfectly on RunPod with version v8, but when I tried to set up version v9 on a new RunPod instance, I got this error: ----- Traceback (most recent call last): File "/workspace/IDM-VTON/app_VTON.py", line 5, in from src.unet_hacked_garmnet import UNet2DConditionModel as UNet2DConditionModel_ref File "/workspace/IDM-VTON/src/unet_hacked_garmnet.py", line 35, in from diffusers.models.embeddings import ( ImportError: cannot import name 'PositionNet' from 'diffusers.models.embeddings' (/workspace/IDM-VTON/venv/lib/python3.10/site-packages/diffusers/models/embeddings.py) ----- I think this may be caused by the v9 version using newer diffusers, but I cannot fix it? Could you kindly give me some suggestions or consider updating the script?

faraway zheng

hi, I got the error below: ================================= File "/root/autodl-tmp/IDM-VTON2/preprocess/openpose/run_openpose.py", line 48, in __call__ pose, detected_map = self.preprocessor(input_image, hand_and_face=False) File "/root/autodl-tmp/IDM-VTON2/preprocess/openpose/annotator/openpose/__init__.py", line 72, in __call__ candidate, subset = self.body_estimation(oriImg) File "/root/autodl-tmp/IDM-VTON2/preprocess/openpose/annotator/openpose/body.py", line 63, in __call__ heatmap = util.smart_resize_k(heatmap, fx=stride, fy=stride) File "/root/autodl-tmp/IDM-VTON2/preprocess/openpose/annotator/openpose/util.py", line 35, in smart_resize_k return np.stack([smart_resize_k(x[:, :, i], fx, fy) for i in range(Co)], axis=2) File "/root/autodl-tmp/IDM-VTON2/preprocess/openpose/annotator/openpose/util.py", line 35, in return np.stack([smart_resize_k(x[:, :, i], fx, fy) for i in range(Co)], axis=2) File "/root/autodl-tmp/IDM-VTON2/preprocess/openpose/annotator/openpose/util.py", line 33, in smart_resize_k return cv2.resize(x, (int(Wt), int(Ht)), interpolation=cv2.INTER_AREA if k < 1 else cv2.INTER_LANCZOS4) cv2.error: OpenCV(4.7.0) :-1: error: (-5:Bad argument) in function 'resize' > Overload resolution failed: > - src data type = 23 is not supported > - Expected Ptr for argument 'src' =========================================== I fixed this error by modifying the body.py from: --------------------------------------------------------------------------- heatmap = util.smart_resize_k(heatmap, fx=stride, fy=stride) --------------------------------------------------------------------------- to: --------------------------------------------------------------------------- heatmap = util.smart_resize_k(heatmap.astype(np.float32), fx=stride, fy=stride) --------------------------------------------------------------------------- it does work for me, but I don't know why I got this error