5.9 KiB
5.9 KiB
Contributing to ComfyUI-HunyuanWorld
Thank you for your interest in contributing to ComfyUI-HunyuanWorld! We welcome contributions from the community.
🤝 How to Contribute
Reporting Bugs
- Check if the bug has already been reported in Issues
- If not, create a new issue using the bug report template
- Include as much detail as possible (OS, Python version, error logs, etc.)
Suggesting Features
- Check if the feature has already been requested
- Create a new issue using the feature request template
- Describe your use case and why the feature would be valuable
Contributing Code
Setting Up Development Environment
# Fork the repository on GitHub
# Clone your fork
git clone https://github.com/A043-studios/ComfyUI_HunyuanWorldnode.git
cd ComfyUI_HunyuanWorldnode
# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install development dependencies
pip install -r requirements.txt
pip install -e .[dev]
# Install pre-commit hooks
pre-commit install
Making Changes
-
Create a new branch for your feature/fix:
git checkout -b feature/your-feature-name -
Make your changes following our coding standards:
- Use Black for code formatting:
black . - Use isort for import sorting:
isort . - Follow PEP 8 guidelines
- Add type hints where appropriate
- Write docstrings for new functions/classes
- Use Black for code formatting:
-
Add tests for new functionality:
# Run tests pytest tests/ # Run with coverage pytest --cov=hunyuanworld tests/ -
Update documentation:
- Update README.md if needed
- Update CHANGELOG.md
- Add docstrings to new code
- Update example workflows if applicable
-
Commit your changes:
git add . git commit -m "feat: add new feature description"Use conventional commit messages:
feat:for new featuresfix:for bug fixesdocs:for documentation changesstyle:for formatting changesrefactor:for code refactoringtest:for adding testschore:for maintenance tasks
-
Push to your fork and create a Pull Request:
git push origin feature/your-feature-name
Pull Request Guidelines
- Fill out the PR template completely
- Ensure all tests pass
- Update documentation as needed
- Keep PRs focused on a single feature/fix
- Write clear commit messages
- Be responsive to feedback
🧪 Testing
Running Tests
# Run all tests
pytest
# Run specific test file
pytest tests/test_nodes.py
# Run with coverage
pytest --cov=hunyuanworld --cov-report=html
Test Categories
- Unit tests: Test individual functions/classes
- Integration tests: Test node interactions
- Compatibility tests: Test with different Python/PyTorch versions
- Performance tests: Test memory usage and speed
Writing Tests
- Place tests in the
tests/directory - Name test files
test_*.py - Use descriptive test names
- Test both success and failure cases
- Mock external dependencies when appropriate
📝 Documentation
Code Documentation
- Write clear docstrings for all public functions/classes
- Use Google-style docstrings
- Include parameter types and return types
- Provide usage examples for complex functions
User Documentation
- Update README.md for user-facing changes
- Add examples to
example_workflows.json - Update troubleshooting section for common issues
- Keep documentation up-to-date with code changes
🎨 Code Style
Python Style Guide
- Follow PEP 8
- Use Black for formatting (line length: 100)
- Use isort for import sorting
- Use type hints where possible
- Prefer descriptive variable names
Example:
from typing import Optional, Tuple
import torch
from PIL import Image
def process_image(
image: Image.Image,
target_size: Tuple[int, int] = (512, 512),
normalize: bool = True
) -> torch.Tensor:
"""
Process an input image for 3D generation.
Args:
image: Input PIL image
target_size: Target dimensions (width, height)
normalize: Whether to normalize pixel values to [0,1]
Returns:
Processed image tensor
Example:
>>> img = Image.open("test.jpg")
>>> tensor = process_image(img, (1024, 1024))
"""
# Implementation here
pass
🚀 Release Process
Version Numbering
We follow Semantic Versioning:
MAJOR.MINOR.PATCH- Major: Breaking changes
- Minor: New features (backward compatible)
- Patch: Bug fixes (backward compatible)
Release Checklist
- Update version in
setup.pyandpyproject.toml - Update
CHANGELOG.md - Run full test suite
- Update documentation
- Create release PR
- Tag release after merge
- Publish to PyPI (if applicable)
🏷️ Issue Labels
bug: Something isn't workingenhancement: New feature or requestdocumentation: Improvements or additions to docsgood first issue: Good for newcomershelp wanted: Extra attention is neededquestion: Further information is requestedwontfix: This will not be worked on
💬 Community Guidelines
Be Respectful
- Use welcoming and inclusive language
- Be respectful of differing viewpoints
- Accept constructive criticism gracefully
- Focus on what's best for the community
Be Helpful
- Help newcomers get started
- Share knowledge and experience
- Provide constructive feedback
- Be patient with questions
📞 Getting Help
- Questions: Open a GitHub issue with the
questionlabel - Bugs: Use the bug report template
- Features: Use the feature request template
- Security: Email security issues privately (if applicable)
🙏 Recognition
Contributors will be recognized in:
CONTRIBUTORS.mdfile- Release notes
- GitHub contributors page
Thank you for contributing to ComfyUI-HunyuanWorld! 🌍✨