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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 61 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,64 @@ Wan2.1-T2V-14B/
Wan2.1-T2V-1.3B/
Wan2.1-I2V-14B-480P/
Wan2.1-I2V-14B-720P/
Phantom-Wan-1.3B/
Phantom-Wan-1.3B/

# Testing
.pytest_cache/
.coverage
htmlcov/
coverage.xml
*.cover
*.py.cover
.hypothesis/
.tox/
.nox/
.cache
nosetests.xml
coverage/

# Claude
.claude/

# Virtual environments
venv/
.venv/
env/
ENV/
env.bak/
venv.bak/
.python-version

# IDE and editors
.vscode/
.idea/
*.swp
*.swo
*~
.project
.pydevproject
.settings/

# Build artifacts
build/
dist/
*.egg-info/
*.egg
eggs/
wheels/
pip-wheel-metadata/
share/python-wheels/

# MyPy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
4,034 changes: 4,034 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

172 changes: 172 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
[tool.poetry]
name = "phantom-wan"
version = "0.1.0"
description = "Phantom - Subject-Consistent Video Generation with Wan2.1"
authors = ["Phantom Contributors"]
readme = "README.md"
packages = [{include = "phantom_wan"}]

[tool.poetry.dependencies]
python = "^3.10"
torch = ">=2.4.0"
torchvision = ">=0.19.0"
opencv-python = ">=4.9.0.80"
diffusers = ">=0.31.0"
transformers = ">=4.49.0"
tokenizers = ">=0.20.3"
accelerate = ">=1.1.1"
tqdm = "*"
imageio = "*"
easydict = "*"
ftfy = "*"
dashscope = "*"
imageio-ffmpeg = "*"
flash-attn = {version = "*", optional = true}
gradio = ">=5.0.0"
numpy = ">=1.23.5,<2"
xfuser = ">=0.4.1"

[tool.poetry.extras]
cuda = ["flash-attn"]

[tool.poetry.group.dev.dependencies]
pytest = "^8.0.0"
pytest-cov = "^5.0.0"
pytest-mock = "^3.14.0"
pytest-xdist = "^3.6.0"
pytest-timeout = "^2.3.0"
black = "^24.0.0"
isort = "^5.13.0"
flake8 = "^7.0.0"
mypy = "^1.10.0"
pre-commit = "^3.7.0"

[tool.poetry.scripts]
test = "pytest:main"
tests = "pytest:main"

[tool.pytest.ini_options]
minversion = "8.0"
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py", "tests.py"]
python_classes = ["Test*", "*Tests"]
python_functions = ["test_*", "*_test"]
addopts = [
"-ra",
"--strict-markers",
"--strict-config",
"--tb=short",
"--maxfail=1",
"-v",
]
markers = [
"unit: Unit tests",
"integration: Integration tests",
"slow: Slow running tests",
"gpu: Tests requiring GPU",
"network: Tests requiring network access",
]
filterwarnings = [
"error",
"ignore::UserWarning",
"ignore::DeprecationWarning",
]
norecursedirs = [".git", ".tox", "dist", "build", "*.egg", "__pycache__"]

[tool.coverage.run]
source = ["phantom_wan"]
branch = true
parallel = true
omit = [
"*/tests/*",
"*/test_*",
"*/__init__.py",
"*/setup.py",
"*/conftest.py",
"*/.venv/*",
"*/venv/*",
"*/site-packages/*",
]

[tool.coverage.report]
precision = 2
show_missing = true
skip_covered = false
fail_under = 80
exclude_lines = [
"pragma: no cover",
"def __repr__",
"def __str__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"if typing.TYPE_CHECKING:",
"@abstractmethod",
"@abc.abstractmethod",
"except ImportError:",
"except KeyError:",
"except BaseException:",
"if self.debug:",
"if settings.DEBUG",
"pass",
]

[tool.coverage.html]
directory = "htmlcov"

[tool.coverage.xml]
output = "coverage.xml"

[tool.isort]
profile = "black"
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
line_length = 88
skip_gitignore = true
known_first_party = ["phantom_wan"]

[tool.black]
line-length = 88
target-version = ['py38', 'py39', 'py310', 'py311']
include = '\.pyi?$'
extend-exclude = '''
/(
# directories
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| build
| dist
)/
'''

[tool.mypy]
python_version = "3.8"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = false
disallow_incomplete_defs = false
check_untyped_defs = true
disallow_untyped_decorators = false
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_equality = true
ignore_missing_imports = true
pretty = true
show_error_codes = true
show_error_context = true
show_column_numbers = true

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
Empty file added tests/__init__.py
Empty file.
Loading