muzishen / IMAGDressing

👔IMAGDressing👔: Interactive Modular Apparel Generation for Virtual Dressing. It enables customizable human image generation with flexible garment, pose, and scene control, ensuring high fidelity and garment consistency for virtual try-on.
https://imagdressing.github.io/
Apache License 2.0
1.04k stars 85 forks source link

inference_IMAGdressing_controlnetinpainting.py Error in Google Colab #16

Open devinross opened 4 months ago

devinross commented 4 months ago

Thank you for publishing this repo... Running this project in the Google Colab environment with a GPU. I've successfully ran inference_IMAGdressing.py, but inference_IMAGdressing_controlnetinpainting.py is another story.

!python inference_IMAGdressing_controlnetinpainting.py --cloth_path ../tee.jpg --model_path ../person.png --model_ckpt ../drive/MyDrive/IMAGDressing-v1_512.pt

Yields the following error:

RuntimeError: Device type CUDA is not supported for torch.Generator() api.

/usr/local/lib/python3.10/site-packages/diffusers/utils/outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
  torch.utils._pytree._register_pytree_node(
/usr/local/lib/python3.10/site-packages/diffusers/utils/outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
  torch.utils._pytree._register_pytree_node(
Traceback (most recent call last):
  File "/content/IMAGDressing/inference_IMAGdressing_controlnetinpainting.py", line 179, in <module>
    pipe, generator = prepare(args)
  File "/content/IMAGDressing/inference_IMAGdressing_controlnetinpainting.py", line 63, in prepare
    generator = torch.Generator(device=args.device).manual_seed(42)
RuntimeError: Device type CUDA is not supported for torch.Generator() api.

Any idea on how to fix this?

Outside of installing the requirements, I've had to also install

!pip install torchvision
!pip install onnxruntime
!pip install opencv-python
!pip install matplotlib
!pip install scipy
!pip install scikit-image
!conda install pytorch torchvision cudatoolkit=11.8 -c pytorch

It would be helpful if this was included in the README.

muzishen commented 3 months ago

pytorch version > 2.0 ?

awais-nayyar commented 2 months ago

@devinross now is it running on google colab?