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
138 changes: 137 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,140 @@ pretrained_models/

debug_vis/
pretrained_models
train_data
train_data

#### joe made this: http://goel.io/joe

#####=== Python ===#####

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

__pycache__/
*$py.class
.vscode/
example
input

# Private configuration files
config.private.yml
*.private.*
secrets/
credentials.json

# GitHub Pages related
_site/
.jekyll-cache/
.jekyll-metadata
Gemfile.lock

LHM-0.5B.tar
LHM_prior_model.tar
*.jpg
*.png
comfyui-reactor/
gfpgan/
temp_sync/
~/*
2 changes: 1 addition & 1 deletion ComfyUI-LHM/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Place the weights in the `models` directory inside this node's folder.

## Troubleshooting

If you encounter any issues with the installation or running the node, please check the [TROUBLESHOOTING.md](TROUBLESHOOTING.md) file for solutions to common problems.
If you encounter any issues with the installation or running the node, check the [TROUBLESHOOTING.md](TROUBLESHOOTING.md) file for solutions to common problems.

## License

Expand Down
60 changes: 60 additions & 0 deletions comfy_lhm_node/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Changelog

## 2023-06-20
- Initial release of the LHM ComfyUI node
- Basic implementation with simplified fallback

## 2023-06-30
- Added error handling for missing dependencies
- Improved documentation

## 2023-07-10
- Added support for Pinokio installation
- Created installation guide

## 2023-11-15
- Updated to support LHM 1.0
- Added animation output

## 2024-06-22
- Enhanced troubleshooting guide with detailed installation steps
- Added quality of life improvements for error messages

## 2024-06-25
- Added PyTorch3D installation scripts for Apple Silicon
- Created `install_pytorch3d_mac.sh` - Bash script for installing PyTorch3D on macOS
- Created `install_pytorch3d_mac.py` - Python version of the installation script
- Added `install_pytorch3d_lite.py` - Alternative lightweight implementation
- Added PyTorch3D-Lite compatibility layer for easier installation
- Updated TROUBLESHOOTING.md with detailed instructions for dealing with PyTorch3D installation issues
- Added workaround for animation format issues in simplified mode using Tensor Reshape

## 2024-06-26
- Added optimized PyTorch MPS installation script for Apple Silicon (`install_pytorch_mps.py`)
- Properly configures PyTorch with Metal Performance Shaders (MPS) support
- Attempts to install PyTorch3D from source with appropriate environment variables
- Sets up PyTorch3D-Lite as a fallback in case of installation issues
- Creates a smarter import fix that tries both regular PyTorch3D and the lite version
- Updated TROUBLESHOOTING.md with the new recommended installation method

## 2024-06-27
- Added conda-based installation scripts for PyTorch3D
- Created `install_pytorch3d_conda.sh` - Bash script for installing PyTorch3D using conda
- Created `install_pytorch3d_conda.py` - Python version of the conda installation script
- These scripts provide the most reliable method for installing PyTorch3D
- Added conda-forge channel configuration for consistent package availability
- Enhanced compatibility layer that checks for conda-installed PyTorch3D first
- Updated TROUBLESHOOTING.md to highlight conda as the recommended installation method

## 2024-06-28 (2)
- Added `create_test_workflow.py` script to automatically generate a sample ComfyUI workflow for testing the LHM node
- Updated `TROUBLESHOOTING.md` with direct references to the official PyTorch3D installation documentation
- Reorganized installation sections to prioritize the official PyTorch3D installation methods
- Added detailed environment variable guidance for Apple Silicon users based on successful installations

## 2024-06-28
- Successfully installed PyTorch3D from source following the official documentation
- Added reference to official PyTorch3D installation guide in `TROUBLESHOOTING.md`
- Created `test_imports.py` to verify all dependencies are properly installed
- Updated `lhm_import_fix.py` to prioritize direct PyTorch3D imports and explicit paths to Pinokio's miniconda Python packages
- Fixed dependency installation guidance for macOS with Apple Silicon and environment variable specifications for macOS compilation
82 changes: 82 additions & 0 deletions comfy_lhm_node/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# LHM Node for ComfyUI

A custom node for ComfyUI that integrates the Large Human Model (LHM) for 3D human reconstruction from a single image.

## Features

- Reconstruct 3D human avatars from a single image
- Generate animated sequences with the reconstructed avatar
- Background removal option
- Mesh export option for use in other 3D applications
- Preview scaling for faster testing
- Error handling with fallback to simplified implementation

## Installation

### Prerequisites

- ComfyUI installed and running
- Python 3.10+ with pip

### Installation Steps

1. Clone this repository into your ComfyUI custom_nodes directory:
```bash
cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/aigraphix/comfy_lhm_node.git
```

2. Run the installation script:
```bash
cd comfy_lhm_node
chmod +x install_dependencies.sh
./install_dependencies.sh
```

Alternatively, you can use the Python installation script:
```bash
cd comfy_lhm_node
chmod +x install_dependencies.py
./install_dependencies.py
```

3. Restart ComfyUI

### Optional: Using the Test Workflow

We've included a sample workflow to help you test the LHM node functionality:

1. Run the test workflow creation script:
```bash
cd comfy_lhm_node
chmod +x create_test_workflow.py
./create_test_workflow.py
```

2. Place a test image named `test_human.png` in your ComfyUI input directory

3. In ComfyUI, load the workflow by clicking on the Load button and selecting `lhm_test_workflow.json`

4. Click "Queue Prompt" to run the workflow

The test workflow includes:
- A LoadImage node that loads `test_human.png`
- The LHM Reconstruction node configured with recommended settings
- A TensorReshape node to format the animation output correctly
- Preview Image nodes to display both the processed image and animation frames

## Model Weights

The model weights are automatically downloaded the first time you run the node. If you encounter any issues with the automatic download, you can manually download the weights from:

- https://github.com/YuliangXiu/large-human-model

Place the weights in the `models` directory inside this node's folder.

## Troubleshooting

If you encounter any issues with the installation or running the node, check the [TROUBLESHOOTING.md](TROUBLESHOOTING.md) file for solutions to common problems.

## License

This project is licensed under the terms of the MIT license. See [LICENSE](LICENSE) for more details.
Loading