feat: Add Compatibility for Windows#101
Open
C0nsumption wants to merge 1 commit into
Open
Conversation
Was able to upgrade most modules to most recent versions (torch, diffusers etc...). Downgrade NumPy to <2.0.0 to avoid compatibility issues. Add conditional import and usage of deepspeed. Enhance image-saving logic to handle non-integer filenames. Only tested inference with python sample_t2i.py --prompt 'a picture' --no-enhance Bug: Deepspeed and flash_attn currently not supported.
Open
|
Which python version did you used. But did you use the last version of python for the virtual env ? |
Author
3.10.9 My bad for the delay bud, no github notification. Think it only comes up when quoted. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Windows?
feat: Add Compatibility for Windows
Description
This pull request introduces several changes to ensure compatibility with Windows and the most recent versions of various modules. The following modifications have been made:
Module Upgrades:
torch,diffusers, etc.Downgrade NumPy:
pip install "numpy<2.0.0"Conditional Import and Usage of
deepspeed:deepspeedand add its related arguments only ifdeepspeedis available.ImportErrorand makes the script more robust.Enhance Image-Saving Logic:
get_next_indexfunction to handle non-integer filenames during the image-saving process.Installation Instructions
Clone the Repository:
git clone https://github.com/tencent/HunyuanDiT cd HunyuanDiTInstall Dependencies:
Using a Virtual Environment
Note: These versions are not the ones used in the
requirements.txt, but they allow the use of CUDA 12.1 and the newest versions ofdiffusersandpytorch. (Same as ComfyUI I believe)Using Conda for Closer Compatibility with Original Repository
Run Inference:
python sample_t2i.py --prompt "a woman" --no-enhanceWHY?
Error Encountered
flash_attn: No module named 'flash_attn'deepspeed: No module named 'deepspeed'Solution
Downgrade NumPy:
pip install "numpy<2.0.0"Changes in
hydit/modules/models.py:args.use_flash_attn. If the attribute does not exist, it returnsFalseinstead of raising anAttributeError. This maintains the intended behavior without causing an error.Changes in
hydit/config.py:deepspeedand add its related arguments only ifdeepspeedis available. This ensures thatdeepspeedrelated arguments are only included whendeepspeedis successfully imported, avoiding potentialImportErrorand making the script more robust.Changes in
sample_t2i.py:get_next_indexfunction to handle non-integer filenames gracefully during the image-saving process. This ensures that the script can handle filenames that do not conform to an integer pattern without breaking.Testing
python sample_t2i.py --prompt "a picture" --no-enhanceKnown Bugs
deepspeedandflash_attnare currently not supported and training is not supported.