Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
94 changes: 47 additions & 47 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
.*
*.py[cod]
# *.jpg
*.jpeg
# *.png
*.gif
*.bmp
*.mp4
*.mov
*.mkv
*.log
*.zip
*.pt
*.pth
*.ckpt
*.safetensors
#*.json
# *.txt
*.backup
*.pkl
*.html
*.pdf
*.whl
*.exe
cache
__pycache__/
storage/
samples/
!.gitignore
!requirements.txt
.DS_Store
*DS_Store
google/
Wan2.1-T2V-14B/
Wan2.1-T2V-1.3B/
Wan2.1-I2V-14B-480P/
Wan2.1-I2V-14B-720P/
outputs/
outputs2/
gradio_outputs/
ckpts/
loras/
loras_i2v/

settings/

wgp_config.json
.*
*.py[cod]
# *.jpg
*.jpeg
# *.png
*.gif
*.bmp
*.mp4
*.mov
*.mkv
*.log
*.zip
*.pt
*.pth
*.ckpt
*.safetensors
#*.json
# *.txt
*.backup
*.pkl
*.html
*.pdf
*.whl
*.exe
cache
__pycache__/
storage/
samples/
!.gitignore
!requirements.txt
.DS_Store
*DS_Store
google/
Wan2.1-T2V-14B/
Wan2.1-T2V-1.3B/
Wan2.1-I2V-14B-480P/
Wan2.1-I2V-14B-720P/
outputs/
outputs2/
gradio_outputs/
ckpts/
loras/
loras_i2v/
settings/
wgp_config.json
16 changes: 0 additions & 16 deletions Custom Resolutions Instructions.txt
Original file line number Diff line number Diff line change
@@ -1,16 +0,0 @@
You can override the choice of Resolutions offered by WanGP, if you create a file "resolutions.json" in the main WanGP folder.
This file is composed of a list of 2 elements sublists. Each 2 elements sublist should have the format ["Label", "WxH"] where W, H are respectively the Width and Height of the resolution. Please make sure that W and H are multiples of 16. The letter "x" should be placed inbetween these two dimensions.

Here is below a sample "resolutions.json" file :

[
["1280x720 (16:9, 720p)", "1280x720"],
["720x1280 (9:16, 720p)", "720x1280"],
["1024x1024 (1:1, 720p)", "1024x1024"],
["1280x544 (21:9, 720p)", "1280x544"],
["544x1280 (9:21, 720p)", "544x1280"],
["1104x832 (4:3, 720p)", "1104x832"],
["832x1104 (3:4, 720p)", "832x1104"],
["960x960 (1:1, 720p)", "960x960"],
["832x480 (16:9, 480p)", "832x480"]
]
184 changes: 92 additions & 92 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,92 +1,92 @@
FROM nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04

# Build arg for GPU architectures - specify which CUDA compute capabilities to compile for
# Common values:
# 7.0 - Tesla V100
# 7.5 - RTX 2060, 2070, 2080, Titan RTX
# 8.0 - A100, A800 (Ampere data center)
# 8.6 - RTX 3060, 3070, 3080, 3090 (Ampere consumer)
# 8.9 - RTX 4070, 4080, 4090 (Ada Lovelace)
# 9.0 - H100, H800 (Hopper data center)
# 12.0 - RTX 5070, 5080, 5090 (Blackwell) - Note: sm_120 architecture
#
# Examples:
# RTX 3060: --build-arg CUDA_ARCHITECTURES="8.6"
# RTX 4090: --build-arg CUDA_ARCHITECTURES="8.9"
# Multiple: --build-arg CUDA_ARCHITECTURES="8.0;8.6;8.9"
#
# Note: Including 8.9 or 9.0 may cause compilation issues on some setups
# Default includes 8.0 and 8.6 for broad Ampere compatibility
ARG CUDA_ARCHITECTURES="8.0;8.6"

ENV DEBIAN_FRONTEND=noninteractive

# Install system dependencies
RUN apt update && \
apt install -y \
python3 python3-pip git wget curl cmake ninja-build \
libgl1 libglib2.0-0 ffmpeg && \
apt clean

WORKDIR /workspace

COPY requirements.txt .

# Upgrade pip first
RUN pip install --upgrade pip setuptools wheel

# Install requirements if exists
RUN pip install -r requirements.txt

# Install PyTorch with CUDA support
RUN pip install --extra-index-url https://download.pytorch.org/whl/cu124 \
torch==2.6.0+cu124 torchvision==0.21.0+cu124

# Install SageAttention from git (patch GPU detection)
ENV TORCH_CUDA_ARCH_LIST="${CUDA_ARCHITECTURES}"
ENV FORCE_CUDA="1"
ENV MAX_JOBS="1"

COPY <<EOF /tmp/patch_setup.py
import os
with open('setup.py', 'r') as f:
content = f.read()

# Get architectures from environment variable
arch_list = os.environ.get('TORCH_CUDA_ARCH_LIST')
arch_set = '{' + ', '.join([f'"{arch}"' for arch in arch_list.split(';')]) + '}'

# Replace the GPU detection section
old_section = '''compute_capabilities = set()
device_count = torch.cuda.device_count()
for i in range(device_count):
major, minor = torch.cuda.get_device_capability(i)
if major < 8:
warnings.warn(f"skipping GPU {i} with compute capability {major}.{minor}")
continue
compute_capabilities.add(f"{major}.{minor}")'''

new_section = 'compute_capabilities = ' + arch_set + '''
print(f"Manually set compute capabilities: {compute_capabilities}")'''

content = content.replace(old_section, new_section)

with open('setup.py', 'w') as f:
f.write(content)
EOF

RUN git clone https://github.com/thu-ml/SageAttention.git /tmp/sageattention && \
cd /tmp/sageattention && \
python3 /tmp/patch_setup.py && \
pip install --no-build-isolation .

RUN useradd -u 1000 -ms /bin/bash user

RUN chown -R user:user /workspace

RUN mkdir /home/user/.cache && \
chown -R user:user /home/user/.cache

COPY entrypoint.sh /workspace/entrypoint.sh

ENTRYPOINT ["/workspace/entrypoint.sh"]
FROM nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04
# Build arg for GPU architectures - specify which CUDA compute capabilities to compile for
# Common values:
# 7.0 - Tesla V100
# 7.5 - RTX 2060, 2070, 2080, Titan RTX
# 8.0 - A100, A800 (Ampere data center)
# 8.6 - RTX 3060, 3070, 3080, 3090 (Ampere consumer)
# 8.9 - RTX 4070, 4080, 4090 (Ada Lovelace)
# 9.0 - H100, H800 (Hopper data center)
# 12.0 - RTX 5070, 5080, 5090 (Blackwell) - Note: sm_120 architecture
#
# Examples:
# RTX 3060: --build-arg CUDA_ARCHITECTURES="8.6"
# RTX 4090: --build-arg CUDA_ARCHITECTURES="8.9"
# Multiple: --build-arg CUDA_ARCHITECTURES="8.0;8.6;8.9"
#
# Note: Including 8.9 or 9.0 may cause compilation issues on some setups
# Default includes 8.0 and 8.6 for broad Ampere compatibility
ARG CUDA_ARCHITECTURES="8.0;8.6"
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies
RUN apt update && \
apt install -y \
python3 python3-pip git wget curl cmake ninja-build \
libgl1 libglib2.0-0 ffmpeg && \
apt clean
WORKDIR /workspace
COPY requirements.txt .
# Upgrade pip first
RUN pip install --upgrade pip setuptools wheel
# Install requirements if exists
RUN pip install -r requirements.txt
# Install PyTorch with CUDA support
RUN pip install --extra-index-url https://download.pytorch.org/whl/cu124 \
torch==2.6.0+cu124 torchvision==0.21.0+cu124
# Install SageAttention from git (patch GPU detection)
ENV TORCH_CUDA_ARCH_LIST="${CUDA_ARCHITECTURES}"
ENV FORCE_CUDA="1"
ENV MAX_JOBS="1"
COPY <<EOF /tmp/patch_setup.py
import os
with open('setup.py', 'r') as f:
content = f.read()
# Get architectures from environment variable
arch_list = os.environ.get('TORCH_CUDA_ARCH_LIST')
arch_set = '{' + ', '.join([f'"{arch}"' for arch in arch_list.split(';')]) + '}'
# Replace the GPU detection section
old_section = '''compute_capabilities = set()
device_count = torch.cuda.device_count()
for i in range(device_count):
major, minor = torch.cuda.get_device_capability(i)
if major < 8:
warnings.warn(f"skipping GPU {i} with compute capability {major}.{minor}")
continue
compute_capabilities.add(f"{major}.{minor}")'''
new_section = 'compute_capabilities = ' + arch_set + '''
print(f"Manually set compute capabilities: {compute_capabilities}")'''
content = content.replace(old_section, new_section)
with open('setup.py', 'w') as f:
f.write(content)
EOF
RUN git clone https://github.com/thu-ml/SageAttention.git /tmp/sageattention && \
cd /tmp/sageattention && \
python3 /tmp/patch_setup.py && \
pip install --no-build-isolation .
RUN useradd -u 1000 -ms /bin/bash user
RUN chown -R user:user /workspace
RUN mkdir /home/user/.cache && \
chown -R user:user /home/user/.cache
COPY entrypoint.sh /workspace/entrypoint.sh
ENTRYPOINT ["/workspace/entrypoint.sh"]
92 changes: 46 additions & 46 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
WanGP NON-COMMERCIAL EVALUATION LICENSE 1.0

Definitions
1.1 “Software” means the source code, binaries, libraries, utilities and UI released under this license.
1.2 “Output” means images, videos or other media produced by running the Software.
1.3 “Commercial Use” means:
a) selling, sublicensing, renting, leasing, or otherwise distributing the Software, in whole or in part, for a fee or other consideration; or
b) offering the Software (or any derivative) as part of a paid product or hosted service; or
c) using the Software (or any derivative) to provide cloud-based or backend services, where end users access or pay for those services.

License Grant
Subject to Section 3:
a) You are granted a worldwide, non-exclusive, royalty-free, revocable license to use, reproduce, modify and distribute the Software for non-commercial purposes only.
b) You are granted a worldwide, non-exclusive, royalty-free, irrevocable license to use, reproduce, modify and distribute the Output for any purpose, including commercial sale, provided that any commercial distribution of the Output includes a clear notice that the Output was produced (in whole or in part) using WanGP, along with a hyperlink to the WanGP application’s About tab or repository.

Restrictions
3.1 You MAY NOT distribute, sublicense or otherwise make available the Software (or any derivative) for Commercial Use.
3.2 You MAY sell, license or otherwise commercially exploit the Output without restriction.
3.3 If you wish to use the Software for Commercial Use, you must obtain a separate commercial license from the Licensor.

Third-Party Components 4.1 The Software includes components licensed under various open-source licenses (e.g., Apache 2.0, MIT, BSD). 4.2 You must comply with all applicable terms of those third-party licenses, including preservation of copyright notices, inclusion of required license texts, and patent-grant provisions. 4.3 You can find the full text of each third-party license via the “About” tab in the WanGP application, which provides links to their original GitHub repositories.

Attribution
5.1 You must give appropriate credit by including:
• a copy of this license (or a link to it), and
• a notice that your use is based on “WanGP”.
5.2 You may do so in any reasonable manner, but not in any way that suggests the Licensor endorses you or your use.

Disclaimer of Warranty & Liability
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE.

Commercial Licensing The Licensor may offer commercial licenses for the Software, which grant rights to use the Software for Commercial Use. Please contact [deepbeepmeep@yahoo.com] for terms and pricing.

Effective Date & Previous Versions
8.1 This license is effective as of the date the LICENSE file is updated in the WanGP repository.
8.2 Any copies of the Software obtained under prior license terms before this Effective Date remain governed by those prior terms; such granted rights are irrevocable.
8.3 Use of the Software after the release of any subsequent version by the Licensor is subject to the terms of the then-current license, unless a separate agreement is in place.

Acceptable Use / Moral Clause
9.1 You MAY NOT use the Software or the Output to facilitate or produce content that is illegal, harmful, violent, harassing, defamatory, fraudulent, or otherwise violates applicable laws or fundamental human rights.
9.2 You MAY NOT deploy the Software or Output in contexts that promote hate speech, extremist ideology, human rights abuses, or other actions that could foreseeably cause significant harm to individuals or groups.
9.3 The Licensor reserves the right to terminate the rights granted under this license if a licensee materially breaches this Acceptable Use clause.

END OF LICENSE

WanGP NON-COMMERCIAL EVALUATION LICENSE 1.0
Definitions
1.1 “Software” means the source code, binaries, libraries, utilities and UI released under this license.
1.2 “Output” means images, videos or other media produced by running the Software.
1.3 “Commercial Use” means:
a) selling, sublicensing, renting, leasing, or otherwise distributing the Software, in whole or in part, for a fee or other consideration; or
b) offering the Software (or any derivative) as part of a paid product or hosted service; or
c) using the Software (or any derivative) to provide cloud-based or backend services, where end users access or pay for those services.
License Grant
Subject to Section 3:
a) You are granted a worldwide, non-exclusive, royalty-free, revocable license to use, reproduce, modify and distribute the Software for non-commercial purposes only.
b) You are granted a worldwide, non-exclusive, royalty-free, irrevocable license to use, reproduce, modify and distribute the Output for any purpose, including commercial sale, provided that any commercial distribution of the Output includes a clear notice that the Output was produced (in whole or in part) using WanGP, along with a hyperlink to the WanGP application’s About tab or repository.
Restrictions
3.1 You MAY NOT distribute, sublicense or otherwise make available the Software (or any derivative) for Commercial Use.
3.2 You MAY sell, license or otherwise commercially exploit the Output without restriction.
3.3 If you wish to use the Software for Commercial Use, you must obtain a separate commercial license from the Licensor.
Third-Party Components 4.1 The Software includes components licensed under various open-source licenses (e.g., Apache 2.0, MIT, BSD). 4.2 You must comply with all applicable terms of those third-party licenses, including preservation of copyright notices, inclusion of required license texts, and patent-grant provisions. 4.3 You can find the full text of each third-party license via the “About” tab in the WanGP application, which provides links to their original GitHub repositories.
Attribution
5.1 You must give appropriate credit by including:
• a copy of this license (or a link to it), and
• a notice that your use is based on “WanGP”.
5.2 You may do so in any reasonable manner, but not in any way that suggests the Licensor endorses you or your use.
Disclaimer of Warranty & Liability
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE.
Commercial Licensing The Licensor may offer commercial licenses for the Software, which grant rights to use the Software for Commercial Use. Please contact [deepbeepmeep@yahoo.com] for terms and pricing.
Effective Date & Previous Versions
8.1 This license is effective as of the date the LICENSE file is updated in the WanGP repository.
8.2 Any copies of the Software obtained under prior license terms before this Effective Date remain governed by those prior terms; such granted rights are irrevocable.
8.3 Use of the Software after the release of any subsequent version by the Licensor is subject to the terms of the then-current license, unless a separate agreement is in place.
Acceptable Use / Moral Clause
9.1 You MAY NOT use the Software or the Output to facilitate or produce content that is illegal, harmful, violent, harassing, defamatory, fraudulent, or otherwise violates applicable laws or fundamental human rights.
9.2 You MAY NOT deploy the Software or Output in contexts that promote hate speech, extremist ideology, human rights abuses, or other actions that could foreseeably cause significant harm to individuals or groups.
9.3 The Licensor reserves the right to terminate the rights granted under this license if a licensee materially breaches this Acceptable Use clause.
END OF LICENSE
Loading