diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index cfefbd0..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "chord"] - path = chord - url = https://github.com/ubisoft/ubisoft-laforge-chord.git diff --git a/README.md b/README.md index c758182..3c86cf8 100644 --- a/README.md +++ b/README.md @@ -19,14 +19,14 @@ ComfyUI custom node for the paper: **Chord: Chain of Rendering Decomposition for ```shell # Clone the repository cd ./ComfyUI/custom_nodes -git clone --recursive https://github.com/ubisoft/ComfyUI-Chord.git +git clone https://github.com/ubisoft/ComfyUI-Chord.git # Install dependencies -## For Python version -pip install -r .\ComfyUI-Chord\requirements.txt - ## Or for Windows portable version ..\..\python_embeded\python.exe -s -m pip install -r .\ComfyUI-Chord\requirements.txt + +## For Python version +pip install -r .\ComfyUI-Chord\requirements.txt ``` 4. When running the nodes for the first time, they will download the model **Stable Diffusion 2.1** from this repository on the Hugging Face hub: [RedbeardNZ/stable-diffusion-2-1-base](https://huggingface.co/RedbeardNZ/stable-diffusion-2-1-base). The download will be placed in the Hugging Face cache folder `C:\Users\[your-username]\.cache\huggingface\hub\models--RedbeardNZ--stable-diffusion-2-1-base`. We are working on simplifying this dependency to have all models centralized in the ComfyUI models folder. diff --git a/__init__.py b/__init__.py index 1a05868..3702278 100644 --- a/__init__.py +++ b/__init__.py @@ -1,11 +1,11 @@ -import os,sys -sys.path.append(os.path.join(os.path.dirname(__file__), "chord")) - from .nodes import ChordLoadModel, ChordMaterialEstimation, ChordNormalToHeight + NODE_CLASS_MAPPINGS = { "ChordLoadModel": ChordLoadModel, "ChordMaterialEstimation": ChordMaterialEstimation, "ChordNormalToHeight": ChordNormalToHeight, } + + __all__ = ["NODE_CLASS_MAPPINGS"] \ No newline at end of file diff --git a/config/chord.yaml b/config/chord.yaml new file mode 100644 index 0000000..56960da --- /dev/null +++ b/config/chord.yaml @@ -0,0 +1,29 @@ +model: + name: chord + roughness_step: 5. + metallic_step: 1. + # format: "OutputMapName": ConvInInput1_ConvInInput2_{0/1} + # 0/1 stands for using gt/pred image; + chain_type: chord + chain_library: + chord: + basecolor: render_0 + normal: render_approxIrr_01 + rou_met: render_approxRM_01 + rgbx_prompts: + basecolor: Basecolor + normal: Normal + roughness: Roughness + metallic: Metallic + irradiance: Irradiance + rou_met: Roughness and Metallic + prior_light: + name: distant-light + direction: [-1.0, -1.0, 1.0] # Top-left corner towards bottom right + color: [23.47, 21.31, 20.79] + power: 0.1 + stable_diffusion: + name: stable_diffusion + fp16: true + vae_padding: circular + version: 2.1 diff --git a/nodes.py b/nodes.py index d3967e4..d51198c 100644 --- a/nodes.py +++ b/nodes.py @@ -12,7 +12,7 @@ from comfy.utils import load_torch_file from comfy.model_patcher import ModelPatcher # Modules from ComfyUI-Chord -from chord import ChordModel +from .chord import ChordModel def apply_padding(model, mode): for layer in [layer for _, layer in model.named_modules() if isinstance(layer, torch.nn.Conv2d)]: @@ -51,7 +51,7 @@ class ChordLoadModel(io.ComfyNode): if type(ckpt_name) is list: ckpt_name = ckpt_name[0] ckpt_path = folder_paths.get_full_path("checkpoints", ckpt_name) - config = OmegaConf.load(os.path.join(os.path.dirname(__file__), "chord/config/chord.yaml")) + config = OmegaConf.load(os.path.join(os.path.dirname(__file__), "config/chord.yaml")) model = ChordModel(config) sd = load_torch_file(ckpt_path, safe_load=True) try: diff --git a/requirements.txt b/requirements.txt index b8d2357..079f01b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,8 @@ -huggingface_hub[hf_xet] diffusers +huggingface_hub[hf_xet] +imageio omegaconf -imageio \ No newline at end of file +tokenizers +tqdm +transformers +typer \ No newline at end of file