Compare commits

..
2 Commits
Author SHA1 Message Date
Mel Massadian 9f982c205a release: 📦 add build 2024-11-04 00:40:48 +01:00
Mel Massadian 5d7950abb9 docs: 📚 add gitignore 2024-11-03 14:46:41 +01:00
400 changed files with 805 additions and 13354 deletions
-34
View File
@@ -1,34 +0,0 @@
# Include any files or directories that you don't want to be copied to your
# container here (e.g., local build artifacts, temporary files, etc.).
#
# For more help, visit the .dockerignore file reference guide at
# https://docs.docker.com/engine/reference/builder/#dockerignore-file
**/.DS_Store
**/__pycache__
**/.venv
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/bin
**/charts
**/docker-compose*
**/compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
-5
View File
@@ -1,5 +0,0 @@
* @melMass
extern/GFPGAN/* @TencentARC
extern/SadTalker/* @OpenTalker
nodes/deep_bump.py @HugoTini
web/imageFeed.js @pythongosssss @melMass
-14
View File
@@ -1,14 +0,0 @@
# These are supported funding model platforms
github: [melMass]
custom: ["https://www.buymeacoffee.com/melmass"]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
-67
View File
@@ -1,67 +0,0 @@
name: 🐞 Bug Report
title: "[bug] "
description: Report a bug
labels: ["type: 🐛 bug", "status: 🧹 needs triage"]
body:
- type: markdown
attributes:
value: |
## Before submiting an issue
- Make sure to read the README & INSTALL instructions.
- Please search for [existing issues](https://github.com/melMass/comfy_mtb/issues?q=is%3Aissue) around your problem before filing a report.
### Try using the debug mode to get more info
If you use the env variable `MTB_DEBUG=true`, debug message from the extension will appear in the terminal.
- type: textarea
id: description
attributes:
label: Describe the bug
description: A clear description of what the bug is. Include screenshots if applicable.
placeholder: Bug description
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Reproduction
description: Steps to reproduce the behavior.
placeholder: |
1. Add node xxx ...
2. Connect to xxx ...
3. See error
- type: textarea
id: expected-behavior
attributes:
label: Expected behavior
description: A clear description of what you expected to happen.
- type: textarea
id: info
attributes:
label: Platform and versions
description: "informations about the environment you run Comfy in"
render: sh
placeholder: |
- OS: [e.g. Linux]
- Comfy Mode [e.g. custom env, standalone, google colab]
validations:
required: true
- type: textarea
id: logs
attributes:
label: Console output
description: Paste the console output without backticks
render: sh
- type: textarea
id: context
attributes:
label: Additional context
description: Add any other context about the problem here.
-1
View File
@@ -1 +0,0 @@
blank_issues_enabled: false
@@ -1,35 +0,0 @@
name: 💡 Feature Request
title: "[feat] "
description: Suggest an idea
labels: ["type: 🤚 feature request"]
body:
- type: textarea
id: problem
attributes:
label: Describe the problem
description: A clear description of the problem this feature would solve
placeholder: "I'm always frustrated when..."
validations:
required: true
- type: textarea
id: solution
attributes:
label: "Describe the solution you'd like"
description: A clear description of what change you would like
placeholder: "I would like to..."
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Alternatives considered
description: "Any alternative solutions you've considered"
- type: textarea
id: context
attributes:
label: Additional context
description: Add any other context about the problem here.
-72
View File
@@ -1,72 +0,0 @@
name: 📦 Building wheels
on:
workflow_dispatch:
# push:
# tags:
# - "v*"
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
platform: win32
arch: x64
# - os: macos-latest
# platform: darwin
# arch: arm64
- os: ubuntu-latest
platform: linux
arch: x64
runs-on: ${{ matrix.os }}
env:
archive_name: deps-wheels_${{ matrix.os }}-${{ matrix.platform }}-${{ matrix.arch }}
steps:
- name: ♻️ Checking out the repository
uses: actions/checkout@v3
- name: "🐍 Setting up Python"
uses: actions/setup-python@v4
with:
python-version: "3.10.9"
- name: 📦 Building and Bundling wheels
shell: bash
run: |
python -m pip wheel --no-cache-dir -r requirements-wheels.txt -w ./wheels 2>&1 | tee build.log
# find source wheels
packages=$(cat build.log | awk -F 'Building wheels for collected packages: ' '{print $2}')
packages=$(echo "$packages" | tr -d '[:space:]')
IFS=', ' read -r -a package_array <<< "$packages"
printf "Autodetect this source package: \e[32m%s\e[0m\n" "${package_array[@]}"
# Iterate through the wheel files and remove those that are not source built
for wheel_file in ./wheels/*.whl; do
# Extract the package name from the wheel filename
package_name=$(basename "$wheel_file" .whl | awk -F '-' '{print $1}')
printf "Checking package: %s\n" "$package_name"
# Check if the package is not in the array of source built packages
if [[ ! " ${package_array[@]} " =~ " ${package_name} " ]]; then
echo "Removing $wheel_file"
rm "$wheel_file"
fi
done
if [ "$RUNNER_OS" == "Windows" ]; then
"C:/Program Files/7-Zip/7z.exe" a -mfb=258 -tzip ${{ env.archive_name }}.zip wheels
else
zip -r -9 -y -m ${{ env.archive_name }}.zip wheels
fi
- name: 💾 Store cache
uses: actions/cache/save@v3
with:
path: ${{ env.archive_name }}.zip
key: ${{ env.archive_name }}
-107
View File
@@ -1,107 +0,0 @@
name: 📦 Release
on:
workflow_dispatch:
inputs:
name:
description: Release tag / name ?
required: true
default: "latest"
type: string
environment:
description: Environment to run tests against
type: environment
required: false
# push:
# tags:
# - "v*"
jobs:
release:
permissions:
contents: write
runs-on: ubuntu-latest
env:
repo_name: ${{ github.event.repository.name }}
steps:
- name: ♻️ Checking out the repository
uses: actions/checkout@v3
with:
submodules: "recursive"
path: ${{ env.repo_name }}
# - name: 📝 Prepare file with paths to remove
# run: |
# find ${{ env.repo_name }} -type f -size +10M > .release_ignore
# find ${{ env.repo_name }} -type d -empty >> .release_ignore
# shell: bash
- name: 🗑️ Remove files and directories listed in .release_ignore
shell: bash
run: |
release_ignore="${{ env.repo_name }}/.release_ignore"
if [ -f "$release_ignore" ]; then
while IFS= read -r entry || [ -n "$entry" ]; do
target="${{ env.repo_name }}/$entry"
if [ -e "$target" ]; then
if [ -f "$target" ]; then
rm "$target"
elif [ -d "$target" ]; then
rm -r "$target"
fi
else
echo "Warning: $entry does not exist in the repository. Skipping removal."
fi
done < "$release_ignore"
else
echo "No .release_ignore file found. Skipping removal of files and directories."
fi
- name: 📦 Building custom comfy nodes
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
"C:/Program Files/7-Zip/7z.exe" a -mfb=258 -tzip ${{ env.repo_name }}-${{ inputs.name }}.zip ${{ env.repo_name }}
else
zip -r -9 -y -m ${{ env.repo_name }}-${{ inputs.name }}.zip ${{ env.repo_name }}
fi
- name: ✅ Create release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ inputs.name }}
files: |
${{ env.repo_name }}-${{ inputs.name }}.zip
release-wheels:
permissions:
contents: write
strategy:
fail-fast: true
matrix:
include:
- os: windows-latest
platform: win32
arch: x64
# - os: macos-latest
# platform: darwin
# arch: arm64
- os: ubuntu-latest
platform: linux
arch: x64
runs-on: ${{ matrix.os }}
env:
archive_name: deps-wheels_${{ matrix.os }}-${{ matrix.platform }}-${{ matrix.arch }}
steps:
- name: 💾 Restore cache
uses: actions/cache/restore@v3
id: cache
with:
path: ${{ env.archive_name }}.zip
key: ${{ env.archive_name }}
- name: ✅ Add wheels to release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ inputs.name }}
files: |
${{ env.archive_name }}.zip
+3 -4
View File
@@ -1,5 +1,4 @@
.svelte-kit
__pycache__
*.py[cod]
*.onnx
wheels/
node_modules/
node_modules
.DS_Store
-9
View File
@@ -1,9 +0,0 @@
[submodule "extern/google-FILM"]
path = extern/frame_interpolation
url = https://github.com/google-research/frame-interpolation
[submodule "extern/GFPGAN"]
path = extern/GFPGAN
url = https://github.com/TencentARC/GFPGAN.git
[submodule "extern/frame_interpolation"]
path = extern/frame_interpolation
url = https://github.com/google-research/frame-interpolation
View File
-6
View File
@@ -1,6 +0,0 @@
{
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"useTabs": false
}
-4
View File
@@ -1,4 +0,0 @@
extern/frame_interpolation/moment.gif
extern/frame_interpolation/photos
extern/GFPGAN/inputs
.git
-93
View File
@@ -1,93 +0,0 @@
# 安装
- [安装](#安装)
- [自动安装(推荐)](#自动安装推荐)
- [ComfyUI 管理器](#comfyui-管理器)
- [虚拟环境](#虚拟环境)
- [模型下载](#模型下载)
- [网络扩展](#网络扩展)
- [旧的安装方法 (MANUAL)](#旧的安装方法-manual)
- [依赖关系](#依赖关系)
### 自动安装(推荐)
### ComfyUI 管理器
从 0.1.0 版开始,该扩展将使用 [ComfyUI-Manager](https://github.com/ltdrdata/ComfyUI-Manager) 进行安装,这对处理各种环境下的各种安装问题大有帮助。
### 虚拟环境
还有一种试验性的单行安装方法,即在 ComfyUI 根目录下使用以下命令进行安装。它将下载代码、安装依赖项并运行安装脚本:
```bash
curl -sSL "https://raw.githubusercontent.com/username/repo/main/install.py" | python3 -
```
## 模型下载
某些节点需要下载额外的模型,您可以使用与上述相同的 python 环境以交互方式完成下载:
```bash
python scripts/download_models.py
```
然后根据提示或直接按回车键下载每个模型。
> **Note**
> 您可以使用以下方法下载所有型号,无需提示:
```bash
python scripts/download_models.py -y
```
#### 网络扩展
首次运行时,脚本会尝试将 [网络扩展](https://github.com/melMass/comfy_mtb/tree/main/web)链接到你的 "web/extensions "文件夹,[请参阅](https://github.com/melMass/comfy_mtb/blob/d982b69a58c05ccead9c49370764beaa4549992a/__init__.py#L45-L61)。
<img alt="color widget preview" src="https://github.com/melMass/comfy_mtb/assets/7041726/cff7e66a-4cc4-4866-b35b-10af0bb2d110" width=450>
### 旧的安装方法 (MANUAL)
### 依赖关系
<details><summary><h4>Custom Virtualenv(我主要用这个)</h4></summary
1. 确保您处于用于 ComfyUI 的 Python 环境中。
2. 运行以下命令安装所需的依赖项:
```bash
pip install -r comfy_mtb/requirements.txt
```
</details>
<details><summary><h4>Comfy 便携式/单机版(来自 ComfyUI 版本)</h4></summary>
如果您使用 ComfyUI 单机版中的 `python-embeded `,那么当二进制文件没有轮子时,您就无法使用 pip 安装二进制文件的依赖项,在这种情况下,请查看最近的 [发布](https://github.com/melMass/comfy_mtb/releases),那里有一个预编译轮子的 linux 和 windows 捆绑包(只有那些需要从源代码编译的轮子),请查看 [此问题 (#1)](https://github.com/melMass/comfy_mtb/issues/1) 以获取更多信息。
![image](https://github.com/melMass/comfy_mtb/assets/7041726/2934fa14-3725-427c-8b9e-2b4f60ba1b7b)
</details>
<details><summary><h4>Google Colab</h4></summary>
在 **Run ComfyUI with localtunnel (Recommended Way)** 标题之后(代码单元格之前)添加一个新的代码单元格
![preview of where to add it on colab](https://github.com/melMass/comfy_mtb/assets/7041726/35df2ef1-14f9-44cd-aa65-353829188cd7)
```python
# download the nodes
!git clone --recursive https://github.com/melMass/comfy_mtb.git custom_nodes/comfy_mtb
# download all models
!python custom_nodes/comfy_mtb/scripts/download_models.py -y
# install the dependencies
!pip install -r custom_nodes/comfy_mtb/requirements.txt -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.0/index.html
```
如果运行后 colab 抱怨需要重新启动运行时,请重新启动,然后不要重新运行之前的单元格,只运行运行本地隧道的单元格。(可能需要先添加一个包含 `%cd ComfyUI` 的单元格)
> **Note**:
> If you don't need all models, remove the `-y` as collab actually supports user input: ![image](https://github.com/melMass/comfy_mtb/assets/7041726/40fc3602-f1d4-432a-98fd-ce2240f5ad06)
> **Preview**
> ![image](https://github.com/melMass/comfy_mtb/assets/7041726/b5b2b2d9-f1e8-4c43-b1db-7dfc5e07be86)
</details>
-93
View File
@@ -1,93 +0,0 @@
# インストール
- [インストール](#インストール)
- [自動インストール (推奨)](#自動インストール-推奨)
- [ComfyUI マネージャ](#comfyui-マネージャ)
- [仮想環境](#仮想環境)
- [モデルのダウンロード](#モデルのダウンロード)
- [ウェブ拡張機能](#ウェブ拡張機能)
- [旧インストール方法 (MANUAL)](#旧インストール方法-manual)
- [依存関係](#依存関係)
## 自動インストール (推奨)
### ComfyUI マネージャ
バージョン0.1.0では、この拡張機能は[ComfyUI-Manager](https://github.com/ltdrdata/ComfyUI-Manager)と一緒にインストールすることを想定しています。これは、様々な環境で直面する様々なインストール問題を処理するのに非常に役立ちます。
### 仮想環境
また、ComfyUIのルートから以下のコマンドを使用する実験的なワンライナー・インストールもあります。これはコードをダウンロードし、依存関係をインストールし、インストールスクリプトを実行します:
```bash
curl -sSL "https://raw.githubusercontent.com/username/repo/main/install.py" | python3 -
```
## モデルのダウンロード
ノードによっては、追加モデルのダウンロードが必要な場合があるので、上記と同じ python 環境を使って対話的に行うことができる:
```bash
python scripts/download_models.py
```
プロンプトに従うか、Enterを押すだけで全てのモデルをダウンロードできます。
> **Note**
> プロンプトを出さずに全てのモデルをダウンロードするには、以下のようにします:
```bash
python scripts/download_models.py -y
```
### ウェブ拡張機能
初回実行時にスクリプトは[web extensions](https://github.com/melMass/comfy_mtb/tree/main/web)をあなたの快適な `web/extensions` フォルダに[シンボリックリンク](https://github.com/melMass/comfy_mtb/blob/d982b69a58c05ccead9c49370764beaa4549992a/__init__.py#L45-L61)しようとします。万が一失敗した場合は、mtbフォルダを手動で`ComfyUI/web/extensions`にコピーしてください:
<img alt="color widget preview" src="https://github.com/melMass/comfy_mtb/assets/7041726/cff7e66a-4cc4-4866-b35b-10af0bb2d110" width=450>
## 旧インストール方法 (MANUAL)
### 依存関係
<details><summary><h4>カスタム Virtualenv (私は主にこれを使っています)</h4></summary>
1. ComfyUIで使用しているPython環境であることを確認してください。
2. 以下のコマンドを実行して、必要な依存関係をインストールします:
```bash
pip install -r comfy_mtb/requirements.txt
```
</details>
<details><summary><h4>Comfy-portable / standalone (ComfyUI リリースより)</h4></summary>。
もしあなたがComfyUIスタンドアロンから`python-embeded`を使用している場合、バイナリがホイールを持っていない場合、依存関係をpipでインストールすることができません。この場合、最後の[リリース](https://github.com/melMass/comfy_mtb/releases)をチェックしてください。(ソースからのビルドが必要なもののみ)あらかじめビルドされたホイールがあるlinuxとwindows用のバンドルがあります。詳細は[この問題(#1)](https://github.com/melMass/comfy_mtb/issues/1)をチェックしてください。
![image](https://github.com/melMass/comfy_mtb/assets/7041726/2934fa14-3725-427c-8b9e-2b4f60ba1b7b)
</details>
<details><summary><h4>Google Colab</h4></summary>
ComfyUI with localtunnel (Recommended Way)**ヘッダーのすぐ後(コードセルの前)に、新しいコードセルを追加してください。
![colabに追加する場所のプレビュー](https://github.com/melMass/comfy_mtb/assets/7041726/35df2ef1-14f9-44cd-aa65-353829188cd7)
```python
# download the nodes
!git clone --recursive https://github.com/melMass/comfy_mtb.git custom_nodes/comfy_mtb
# download all models
!python custom_nodes/comfy_mtb/scripts/download_models.py -y
# install the dependencies
!pip install -r custom_nodes/comfy_mtb/requirements.txt -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.0/index.html
```
これを実行した後、colabがランタイムを再起動する必要があると文句を言ったら、それを実行し、それ以前のセルは再実行せず、localtunnelを実行するセルだけを再実行してください。(最初に`%cd ComfyUI`のセルを追加する必要があるかもしれません...)
> **Note**:
> すべてのモデルが必要でない場合は、`-y`を削除してください : ![image](https://github.com/melMass/comfy_mtb/assets/7041726/40fc3602-f1d4-432a-98fd-ce2240f5ad06)
> **プレビュー**
> ![image](https://github.com/melMass/comfy_mtb/assets/7041726/b5b2b2d9-f1e8-4c43-b1db-7dfc5e07be86)
</details>
-91
View File
@@ -1,91 +0,0 @@
# Installation
- [Installation](#installation)
- [Automatic Install (Recommended)](#automatic-install-recommended)
- [ComfyUI Manager](#comfyui-manager)
- [Virtual Env](#virtual-env)
- [Models Download](#models-download)
- [Web Extensions](#web-extensions)
- [Old installation method (MANUAL)](#old-installation-method-manual)
- [Dependencies](#dependencies)
## Automatic Install (Recommended)
### ComfyUI Manager
As of version 0.1.0, this extension is meant to be installed with the [ComfyUI-Manager](https://github.com/ltdrdata/ComfyUI-Manager), which helps a lot with handling the various install issues faced by various environments.
### Virtual Env
There is also an experimental one liner install using the following command from ComfyUI's root. It will download the code, install the dependencies and run the install script:
```bash
curl -sSL "https://raw.githubusercontent.com/username/repo/main/install.py" | python3 -
```
## Models Download
Some nodes require extra models to be downloaded, you can interactively do it using the same python environment as above:
```bash
python scripts/download_models.py
```
then follow the prompt or just press enter to download every models.
> **Note**
> You can use the following to download all models without prompt:
```bash
python scripts/download_models.py -y
```
### Web Extensions
On first run the script [tries to symlink](https://github.com/melMass/comfy_mtb/blob/d982b69a58c05ccead9c49370764beaa4549992a/__init__.py#L45-L61) the [web extensions](https://github.com/melMass/comfy_mtb/tree/main/web) to your comfy `web/extensions` folder. In case it fails you can manually copy the mtb folder to `ComfyUI/web/extensions` it only provides a color widget for now shared by a few nodes:
<img alt="color widget preview" src="https://github.com/melMass/comfy_mtb/assets/7041726/cff7e66a-4cc4-4866-b35b-10af0bb2d110" width=450>
## Old installation method (MANUAL)
### Dependencies
<details><summary><h4>Custom Virtualenv (I use this mainly)</h4></summary>
1. Make sure you are in the Python environment you use for ComfyUI.
2. Install the required dependencies by running the following command:
```bash
pip install -r comfy_mtb/requirements.txt
```
</details>
<details><summary><h4>Comfy-portable / standalone (from ComfyUI releases)</h4></summary>
If you use the `python-embeded` from ComfyUI standalone then you are not able to pip install dependencies with binaries when they don't have wheels, in this case check the last [release](https://github.com/melMass/comfy_mtb/releases) there is a bundle for linux and windows with prebuilt wheels (only the ones that require building from source), check [this issue (#1)](https://github.com/melMass/comfy_mtb/issues/1) for more info.
![image](https://github.com/melMass/comfy_mtb/assets/7041726/2934fa14-3725-427c-8b9e-2b4f60ba1b7b)
</details>
<details><summary><h4>Google Colab</h4></summary>
Add a new code cell just after the **Run ComfyUI with localtunnel (Recommended Way)** header (before the code cell)
![preview of where to add it on colab](https://github.com/melMass/comfy_mtb/assets/7041726/35df2ef1-14f9-44cd-aa65-353829188cd7)
```python
# download the nodes
!git clone --recursive https://github.com/melMass/comfy_mtb.git custom_nodes/comfy_mtb
# download all models
!python custom_nodes/comfy_mtb/scripts/download_models.py -y
# install the dependencies
!pip install -r custom_nodes/comfy_mtb/requirements.txt -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.0/index.html
```
If after running this, colab complains about needing to restart runtime, do it, and then do not rerun earlier cells, just the one to run the localtunnel. (you might have to add a cell with `%cd ComfyUI` first...)
> **Note**:
> If you don't need all models, remove the `-y` as collab actually supports user input: ![image](https://github.com/melMass/comfy_mtb/assets/7041726/40fc3602-f1d4-432a-98fd-ce2240f5ad06)
> **Preview**
> ![image](https://github.com/melMass/comfy_mtb/assets/7041726/b5b2b2d9-f1e8-4c43-b1db-7dfc5e07be86)
</details>
-21
View File
@@ -1,21 +0,0 @@
MIT License
Copyright (c) 2023 Mel Massadian
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 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, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-99
View File
@@ -1,99 +0,0 @@
# MTB Nodes
<a href="https://www.buymeacoffee.com/melmass" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 32px !important;width: 140px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>
[** 安装指南**](./INSTALL-CN.md) | [** 示例**](https://github.com/melMass/comfy_mtb/wiki/Examples)
欢迎使用 MTB Nodes 项目!这个代码库是开放的,您可以自由地探索和利用。它的主要目的是构建用于 [MLOPs](https://github.com/Bismuth-Consultancy-BV/MLOPs) 中的概念验证(POCs)。该项目中的许多节点都是受到现有社区贡献或内置功能的启发而创建的。
在继续之前,请注意与此项目中使用的某些库相关的许可证。例如,`deepbump` 库采用 [GPLv3](https://github.com/HugoTini/DeepBump/blob/master/LICENSE) 许可证。
- [节点列表](#节点列表)
- [bbox](#bbox)
- [colors](#colors)
- [人脸检测/交换](#人脸检测交换)
- [图像插值(动画)](#图像插值动画)
- [图像操作](#图像操作)
- [潜在变量工具](#潜在变量工具)
- [其他工具](#其他工具)
- [纹理](#纹理)
- [Comfy 资源](#comfy-资源)
# 节点列表
## bbox
- `Bounding Box`: BBox 构造函数(自定义类型)
- `BBox From Mask`: 从遮罩中提取边界框
- `Crop`: 根据边界框裁剪图像
- `Uncrop`: 根据边界框还原图像
## colors
- `Colored Image`: 给定尺寸的纯色图像
- `RGB to HSV`: -
- `HSV to RGB`: -
- `Color Correct`: 基本颜色校正工具
<img src="https://github.com/melMass/comfy_mtb/assets/7041726/7c20ac83-31ff-40ea-a1a0-06c2acefb2ef" width=345/>
## 人脸检测/交换
- `Face Swap`: 使用 deepinsight/insightface 模型进行人脸交换(该节点在早期版本中称为 `Roop`,功能相同,`Roop` 只是使用这些模型的应用程序)
> **注意**
> 人脸索引允许您选择要替换的人脸,如下所示:
<img src="https://github.com/melMass/comfy_mtb/assets/7041726/2e9d6066-c466-4a01-bd6c-315f7f1e8b42" width=320/>
- `Load Face Swap Model`: 加载 insightface 模型用于人脸交换
- `Restore Face`: 使用 [GFPGan](https://github.com/TencentARC/GFPGAN) 还原人脸,与 `Face Swap` 配合使用效果很好,并支持 `bg_upscaler` 的 Comfy 原生放大器
## 图像插值(动画)
- `Load Film Model`: 加载 [FILM](https://github.com/google-research/frame-interpolation) 模型
- `Film Interpolation`: 使用 [FILM](https://github.com/google-research/frame-interpolation) 处理输入帧
<img src="https://github.com/melMass/comfy_mtb/assets/7041726/3afd1647-6634-4b92-a34b-51432e6a9834" width=400/>
- `Export to Prores (experimental)`: 将输入帧导出为 ProRes 4444 mov 文件。这使用 ffmpeg stdin 发送原始的 NumPy 数组,与 `Film Interpolation` 一起使用,目前很简单,但可以进一步扩展。
## 图像操作
- `Blur`: 使用高斯滤波器对图像进行模糊处理。
- `Deglaze Image`: 从 [FN16](https://github.com/Fannovel16/FN16-ComfyUI-nodes/blob/main/DeglazeImage.py) 中提取
- `Denoise`: 对输入图像进行降噪处理
- `Image Compare`: 比较两个图像并返回差异图像
- `Image Premultiply`: 使用掩码对图像进行预乘处理
- `Image Remove Background Rembg`: 使用 [RemBG](https://github.com/danielgatis/rembg) 进行背景去除
<img src="https://github.com/melMass/comfy_mtb/assets/7041726/e69253b4-c03c-45e9-92b5-aa46fb887be8" width=320/>
- `Image Resize Factor`: 大部分提取自 [WAS Node Suite](https://github.com/WASasquatch/was-node-suite-comfyui),经过一些编辑(特别是支持多个图像)和较少的功能。
- `Mask To Image`: 将遮罩(Alpha)转换为带有颜色和背景的 RGB 图像
- `Save Image Grid`: 将输入批次中的所有图像保存为图像网格。
## 潜在变量工具
- `Latent Lerp`: 两个潜在变量之间的线性插值(混合)
## 其他工具
- `Concat Images`: 接受两个图像流,并将它们合并为其他 Comfy 管道支持的图像批次。
- `Image Resize Factor`: **已弃用**,因为我后来发现了内
置的图像调整大小功能。
- `Text To Image`: 使用字体将文本转换为图像的工具
- `Styles Loader`: 加载 csv 文件并从行中填充下拉列表(类似于 A111)
<img src="https://github.com/melMass/comfy_mtb/assets/7041726/02fe3211-18ee-4e54-a029-931388f5fde8" width=320/>
- `Smart Step`: 一个非常基本的节点,用于获取在 KSampler 高级中使用的步骤百分比
- `Qr Code`: 基本的 QR Code 生成器
- `Save Tensors`: 调试节点,将来可能会被删除
- `Int to Number`: 用于 WASSuite 数字节点的补充
- `Smart Step`: 使用百分比来控制 `KAdvancedSampler` 的步骤(开始/停止)
## 纹理
- `DeepBump`: 从单张图片生成法线图和高度图
# Comfy 资源
**指南**:
- [官方示例(英文)](https://comfyanonymous.github.io/ComfyUI_examples/)
- @BlenderNeko 的[ComfyUI 社区手册(英文)](https://blenderneko.github.io/ComfyUI-docs/)
- @tjhayasaka 的[Tomoaki 个人 Wiki(日文)](https://comfyui.creamlab.net/guides/)
**扩展和自定义节点**:
- @WASasquatch 的[Comfy 列表插件(英文)](https://github.com/WASasquatch/comfyui-plugins)
- [CivitAI 上的 ComfyUI 标签(英文)](https://civitai.com/tag/comfyui)
-96
View File
@@ -1,96 +0,0 @@
# MTB Nodes
<a href="https://www.buymeacoffee.com/melmass" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 32px !important;width: 140px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>
[**インストールガイド**](./INSTALL-JP.md) | [**サンプル**](https://github.com/melMass/comfy_mtb/wiki/Examples)
MTB Nodesプロジェクトへようこそ!このコードベースは、自由に探索し、利用することができます。主な目的は、[MLOPs](https://github.com/Bismuth-Consultancy-BV/MLOPs)の実装のための概念実証(POC)を構築することです。このプロジェクトの多くのノードは、既存のコミュニティの貢献や組み込みの機能に触発されています。
続行する前に、このプロジェクトで使用されている特定のライブラリに関連するライセンスに注意してください。たとえば、「deepbump」ライブラリは、[GPLv3](https://github.com/HugoTini/DeepBump/blob/master/LICENSE)の下でライセンスされています。
- [ノードリスト](#ノードリスト)
- [bbox](#bbox)
- [colors](#colors)
- [顔検出 / スワッピング](#顔検出--スワッピング)
- [画像補間(アニメーション)](#画像補間アニメーション)
- [画像操作](#画像操作)
- [潜在的なユーティリティ](#潜在的なユーティリティ)
- [その他のユーティリティ](#その他のユーティリティ)
- [テクスチャ](#テクスチャ)
- [Comfyリソース](#comfyリソース)
# ノードリスト
## bbox
- `Bounding Box`: BBoxコンストラクタ(カスタムタイプ)
- `BBox From Mask`: マスクからバウンディングボックスを抽出
- `Crop`: BBoxから画像を切り抜く
- `Uncrop`: BBoxから画像を元に戻す
## colors
- `Colored Image`: 指定されたサイズの一定の色の画像
- `RGB to HSV`: -
- `HSV to RGB`: -
- `Color Correct`: 基本的なカラーコレクションツール
<img src="https://github.com/melMass/comfy_mtb/assets/7041726/7c20ac83-31ff-40ea-a1a0-06c2acefb2ef" width=345/>
## 顔検出 / スワッピング
- `Face Swap`: deepinsight/insightfaceモデルを使用した顔の入れ替え(このノードは初期バージョンでは「Roop」と呼ばれていましたが、同じ機能を提供します。Roopは単にこれらのモデルを使用するアプリです)
> **注意**
> 顔のインデックスを使用して置き換える顔を選択できます。以下を参照してください:
<img src="https://github.com/melMass/comfy_mtb/assets/7041726/2e9d6066-c466-4a01-bd6c-315f7f1e8b42" width=320/>
- `Load Face Swap Model`: 顔の交換のためのinsightfaceモデルを読み込む
- `Restore Face`: [GFPGan](https://github.com/TencentARC/GFPGAN)を使用して顔を復元し、`Face Swap`と組み合わせて使用すると非常に効果的であり、`bg_upscaler`のComfyネイティブアップスケーラーもサポートしています。
## 画像補間(アニメーション)
- `Load Film Model`: [FILM](https://github.com/google-research/frame-interpolation)モデルを読み込む
- `Film Interpolation`: [FILM](https://github.com/google-research/frame-interpolation)を使用して入力フレームを処理する
<img src="https://github.com/melMass/comfy_mtb/assets/7041726/3afd1647-6634-4b92-a34b-51432e6a9834" width=400/>
- `Export to Prores (experimental)`: 入力フレームをProRes 4444 movファイルにエクスポートします。これは現在は単純なものですが、`Film Interpolation`と組み合わせて使用するためのffmpegのstdinを使用して生のNumPy配列を送信するもので、拡張することもできます。
## 画像操作
- `Blur`: ガウスフィルタを使用して画像をぼかす
- `Deglaze Image`: [FN16](https://github.com/Fannovel16/FN16-ComfyUI-nodes/blob/main/DeglazeImage.py)から取得
- `Denoise`: 入力画像のノイズを除去する
- `Image Compare`: 2つの画像を比較し、差分画像を返す
- `Image Premultiply`: 画像をマスクで乗算
- `Image Remove Background Rembg`: [RemBG](https://github.com/danielgatis/rembg)を使用した背景除去
<img src="https://github.com/melMass/comfy_mtb/assets/704172
6/e69253b4-c03c-45e9-92b5-aa46fb887be8" width=320/>
- `Image Resize Factor`: [WAS Node Suite](https://github.com/WASasquatch/was-node-suite-comfyui)から抽出され、いくつかの編集(特に複数の画像のサポート)と機能の削減が行われました。
- `Mask To Image`: マスク(アルファ)をカラーと背景を持つRGBイメージに変換します。
- `Save Image Grid`: 入力バッチのすべての画像を画像グリッドとして保存します。
## 潜在的なユーティリティ
- `Latent Lerp`: 2つの潜在的なベクトルの間の線形補間(ブレンド)
## その他のユーティリティ
- `Concat Images`: 2つの画像ストリームを取り、他のComfyパイプラインでサポートされている画像のバッチとしてマージします。
- `Image Resize Factor`: **非推奨**。組み込みの画像リサイズ機能を発見したため、削除される予定です。
- `Text To Image`: フォントを使用してテキストを画像に変換するためのユーティリティ
- `Styles Loader`: csvファイルをロードし、行からドロップダウンを作成します(A111のようなもの)
<img src="https://github.com/melMass/comfy_mtb/assets/7041726/02fe3211-18ee-4e54-a029-931388f5fde8" width=320/>
- `Smart Step`: KSamplerの高度な使用に使用するステップパーセントを取得する非常に基本的なノード
- `Qr Code`: 基本的なQRコード生成器
- `Save Tensors`: 将来的に削除される可能性のあるデバッグノード
- `Int to Number`: WASSuiteの数値ノードの補完
- `Smart Step`: `KAdvancedSampler`のステップ(開始/停止)を制御するための非常に基本的なツールで、パーセンテージを使用します。
## テクスチャ
- `DeepBump`: 1枚の画像から法線マップと高さマップを生成します。
# Comfyリソース
**ガイド**:
- [公式の例(英語)](https://comfyanonymous.github.io/ComfyUI_examples/)
- @BlenderNekoによる[ComfyUIコミュニティマニュアル(英語)](https://blenderneko.github.io/ComfyUI-docs/)
- @tjhayasakaによる[Tomoakiの個人Wiki(日本語)](https://comfyui.creamlab.net/guides/)
**拡張機能とカスタムノード**:
- @WASasquatchによる[Comfyリスト用のプラグイン(英語)](https://github.com/WASasquatch/comfyui-plugins)
- [CivitAIのComfyUIタグ(英語)](https://civitai.com/tag/comfyui)
-102
View File
@@ -1,102 +0,0 @@
# MTB Nodes
<!-- omit in toc -->
**Translated Readme (using DeepTranslate, PRs are welcome)**:
![image](https://github.com/melMass/comfy_mtb/assets/7041726/f8429c14-3521-4e28-82a3-863d781976c0)
[日本語による説明](./README-JP.md)
![image](https://github.com/melMass/comfy_mtb/assets/7041726/d5cc1fdd-2820-4a5c-b2d7-482f1c222063)
[中文说明](./README-CN.md)
<a href="https://www.buymeacoffee.com/melmass" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 32px !important;width: 140px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>
[**Install Guide**](./INSTALL.md) | [**Examples**](https://github.com/melMass/comfy_mtb/wiki/Examples)
Welcome to the MTB Nodes project! This codebase is open for you to explore and utilize as you wish. Its primary purpose is to build proof-of-concepts (POCs) for implementation in [MLOPs](https://github.com/Bismuth-Consultancy-BV/MLOPs). Many nodes in this project are inspired by existing community contributions or built-in functionalities.
Before proceeding, please be aware of the licenses associated with certain libraries used in this project. For example, the `deepbump` library is licensed under [GPLv3](https://github.com/HugoTini/DeepBump/blob/master/LICENSE).
- [Node List](#node-list)
- [bbox](#bbox)
- [colors](#colors)
- [face detection / swapping](#face-detection--swapping)
- [image interpolation (animation)](#image-interpolation-animation)
- [image ops](#image-ops)
- [latent utils](#latent-utils)
- [misc utils](#misc-utils)
- [textures](#textures)
- [Comfy Resources](#comfy-resources)
# Node List
## bbox
- `Bounding Box`: BBox constructor (custom type),
- `BBox From Mask`: From a mask extract the bounding box
- `Crop`: Crop image from BBox
- `Uncrop`: Uncrop image from BBox
## colors
- `Colored Image`: Constant color image of given size
- `RGB to HSV`: -,
- `HSV to RGB`: -,
- `Color Correct`: Basic color correction tools
<img src="https://github.com/melMass/comfy_mtb/assets/7041726/7c20ac83-31ff-40ea-a1a0-06c2acefb2ef" width=345/>
## face detection / swapping
- `Face Swap`: Face swap using deepinsight/insightface models (this node used to be called `Roop` in early versions, it does the same, roop is *just* an app that uses those model)
> **Note**
> The face index allow you to choose which face to replace as you can see here:
<img src="https://github.com/melMass/comfy_mtb/assets/7041726/2e9d6066-c466-4a01-bd6c-315f7f1e8b42" width=320/>
- `Load Face Swap Model`: Load an insightface model for face swapping
- `Restore Face`: Using [GFPGan](https://github.com/TencentARC/GFPGAN) to restore faces, works great in conjunction with `Face Swap` and supports Comfy native upscalers for the `bg_upscaler`
## image interpolation (animation)
- `Load Film Model`: Loads a [FILM](https://github.com/google-research/frame-interpolation) model
- `Film Interpolation`: Process input frames using [FILM](https://github.com/google-research/frame-interpolation)
<img src="https://github.com/melMass/comfy_mtb/assets/7041726/3afd1647-6634-4b92-a34b-51432e6a9834" width=400/>
- `Export to Prores (experimental)`: Exports the input frames to a ProRes 4444 mov file. This is using ffmpeg stdin to send raw numpy arrays, used with `Film Interpolation` and very simple for now but could be expanded upon.
## image ops
- `Blur`: Blur an image using a Gaussian filter.
- `Deglaze Image`: taken from [FN16](https://github.com/Fannovel16/FN16-ComfyUI-nodes/blob/main/DeglazeImage.py),
- `Denoise`: Denoise the input image,
- `Image Compare`: Compare two images and return a difference image
- `Image Premultiply`: Premultiply image with mask
- `Image Remove Background Rembg`: [RemBG](https://github.com/danielgatis/rembg) powered background removal.
<img src="https://github.com/melMass/comfy_mtb/assets/7041726/e69253b4-c03c-45e9-92b5-aa46fb887be8" width=320/>
- `Image Resize Factor`: Extracted mostly from [WAS Node Suite](https://github.com/WASasquatch/was-node-suite-comfyui), with a few edits (most notably multiple image support) and less features.
- `Mask To Image`: Converts a mask (alpha) to an RGB image with a color and background
- `Save Image Grid`: Save all the images in the input batch as a grid of images.
## latent utils
- `Latent Lerp`: Linear interpolation (blend) between two latent
## misc utils
- `Concat Images`: Takes two image stream and merge them as a batch of images supported by other Comfy pipelines.
- `Image Resize Factor`: **Deprecated**, I since discovered the builtin image resize.
- `Text To Image`: Utils to convert text to image using a font
- `Styles Loader`: Load csv files and populate a dropdown from the rows (à la A111)
<img src="https://github.com/melMass/comfy_mtb/assets/7041726/02fe3211-18ee-4e54-a029-931388f5fde8" width=320/>
- `Smart Step`: A very basic node to get step percent to use in KSampler advanced,
- `Qr Code`: Basic QR Code generator
- `Save Tensors`: Debug node that will probably be removed in the future
- `Int to Number`: Supplement for WASSuite number nodes
- `Smart Step`: A very basic tool to control the steps (start/stop) of the `KAdvancedSampler` using percentage
## textures
- `DeepBump`: Normal & height maps generation from single pictures
# Comfy Resources
**Guides**:
- [Official Examples (eng)](https://comfyanonymous.github.io/ComfyUI_examples/)
- [ComfyUI Community Manual (eng)](https://blenderneko.github.io/ComfyUI-docs/) by @BlenderNeko
- [Tomoaki's personal Wiki (jap)](https://comfyui.creamlab.net/guides/) by @tjhayasaka
**Extensions and Custom Nodes**:
- [Plugins for Comfy List (eng)](https://github.com/WASasquatch/comfyui-plugins) by @WASasquatch
- [ComfyUI tag on CivitAI (eng)](https://civitai.com/tag/comfyui)
-311
View File
@@ -1,311 +0,0 @@
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
###
# File: __init__.py
# Project: comfy_mtb
# Author: Mel Massadian
# Copyright (c) 2023 Mel Massadian
#
###
import os
# todo: don't override this if the user has that setup already
os.environ["TF_FORCE_GPU_ALLOW_GROWTH"] = "true"
os.environ["TF_GPU_ALLOCATOR"] = "cuda_malloc_async"
import traceback
from .log import log, blue_text, cyan_text, get_summary, get_label
from .utils import here
from .utils import comfy_dir
import importlib
import os
import ast
import json
NODE_CLASS_MAPPINGS = {}
NODE_DISPLAY_NAME_MAPPINGS = {}
NODE_CLASS_MAPPINGS_DEBUG = {}
__version__ = "0.1.2"
def extract_nodes_from_source(filename):
source_code = ""
with open(filename, "r") as file:
source_code = file.read()
nodes = []
try:
parsed = ast.parse(source_code)
for node in ast.walk(parsed):
if isinstance(node, ast.Assign) and len(node.targets) == 1:
target = node.targets[0]
if isinstance(target, ast.Name) and target.id == "__nodes__":
value = ast.get_source_segment(source_code, node.value)
node_value = ast.parse(value).body[0].value
if isinstance(node_value, ast.List) or isinstance(
node_value, ast.Tuple
):
for element in node_value.elts:
if isinstance(element, ast.Name):
print(element.id)
nodes.append(element.id)
break
except SyntaxError:
log.error("Failed to parse")
pass # File couldn't be parsed
return nodes
def load_nodes():
errors = []
nodes = []
nodes_failed = []
for filename in (here / "nodes").iterdir():
if filename.suffix == ".py":
module_name = filename.stem
try:
module = importlib.import_module(
f".nodes.{module_name}", package=__package__
)
_nodes = getattr(module, "__nodes__")
nodes.extend(_nodes)
log.debug(f"Imported {module_name} nodes")
except AttributeError:
pass # wip nodes
except Exception:
error_message = traceback.format_exc().splitlines()[-1]
errors.append(
f"Failed to import module {module_name} because {error_message}"
)
# Read __nodes__ variable from the source file
nodes_failed.extend(extract_nodes_from_source(filename))
if errors:
log.info(
f"Some nodes failed to load:\n\t"
+ "\n\t".join(errors)
+ "\n\n"
+ "Check that you properly installed the dependencies.\n"
+ "If you think this is a bug, please report it on the github page (https://github.com/melMass/comfy_mtb/issues)"
)
return (nodes, nodes_failed)
# - REGISTER WEB EXTENSIONS
web_extensions_root = comfy_dir / "web" / "extensions"
web_mtb = web_extensions_root / "mtb"
if web_mtb.exists():
log.debug(f"Web extensions folder found at {web_mtb}")
if not os.path.islink(web_mtb.as_posix()):
log.warn(
f"Web extensions folder at {web_mtb} is not a symlink, if updating please delete it before"
)
elif web_extensions_root.exists():
web_tgt = here / "web"
src = web_tgt.as_posix()
dst = web_mtb.as_posix()
try:
if os.name == "nt":
import _winapi
_winapi.CreateJunction(src, dst)
else:
os.symlink(web_tgt.as_posix(), web_mtb.as_posix())
except OSError:
log.warn(f"Failed to create symlink to {web_mtb}, trying to copy it")
try:
import shutil
shutil.copytree(web_tgt, web_mtb)
log.info(f"Successfully copied {web_tgt} to {web_mtb}")
except Exception:
log.warn(
f"Failed to symlink and copy {web_tgt} to {web_mtb}. Please copy the folder manually."
)
except Exception: # OSError
log.warn(
f"Failed to create symlink to {web_mtb}. Please copy the folder manually."
)
else:
log.warn(
f"Comfy root probably not found automatically, please copy the folder {web_mtb} manually in the web/extensions folder of ComfyUI"
)
# - REGISTER NODES
nodes, failed = load_nodes()
for node_class in nodes:
class_name = node_class.__name__
node_label = f"{get_label(class_name)} (mtb)"
NODE_CLASS_MAPPINGS[node_label] = node_class
NODE_DISPLAY_NAME_MAPPINGS[class_name] = node_label
NODE_CLASS_MAPPINGS_DEBUG[node_label] = node_class.__doc__
# TODO: I removed this, I find it more convenient to write without spaces, but it breaks every of my workflows
# TODO (cont): and until I find a way to automate the conversion, I'll leave it like this
if os.environ.get("MTB_EXPORT"):
with open(here / "node_list.json", "w") as f:
f.write(
json.dumps(
{
k: NODE_CLASS_MAPPINGS_DEBUG[k]
for k in sorted(NODE_CLASS_MAPPINGS_DEBUG.keys())
},
indent=4,
)
)
log.info(
f"Loaded the following nodes:\n\t"
+ "\n\t".join(
f"{cyan_text(k)}: {blue_text(get_summary(doc)) if doc else '-'}"
for k, doc in NODE_CLASS_MAPPINGS_DEBUG.items()
)
)
# - ENDPOINT
from server import PromptServer
from .log import log
from aiohttp import web
from importlib import reload
import logging
from .endpoint import endlog
if hasattr(PromptServer, "instance"):
@PromptServer.instance.routes.get("/mtb/status")
async def get_full_library(request):
from . import endpoint
reload(endpoint)
endlog.debug("Getting node registration status")
# Check if the request prefers HTML content
if "text/html" in request.headers.get("Accept", ""):
# # Return an HTML page
html_response = endpoint.render_table(
NODE_CLASS_MAPPINGS_DEBUG, title="Registered"
)
html_response += endpoint.render_table(
{k: "-" for k in failed}, title="Failed to load"
)
return web.Response(
text=endpoint.render_base_template("MTB", html_response),
content_type="text/html",
)
return web.json_response(
{
"registered": NODE_CLASS_MAPPINGS_DEBUG,
"failed": failed,
}
)
@PromptServer.instance.routes.post("/mtb/debug")
async def set_debug(request):
json_data = await request.json()
enabled = json_data.get("enabled")
if enabled:
os.environ["MTB_DEBUG"] = "true"
log.setLevel(logging.DEBUG)
log.debug("Debug mode set from API (/mtb/debug POST route)")
else:
if "MTB_DEBUG" in os.environ:
# del os.environ["MTB_DEBUG"]
os.environ.pop("MTB_DEBUG")
log.setLevel(logging.INFO)
return web.json_response(
{"message": f"Debug mode {'set' if enabled else 'unset'}"}
)
@PromptServer.instance.routes.get("/mtb")
async def get_home(request):
from . import endpoint
reload(endpoint)
# Check if the request prefers HTML content
if "text/html" in request.headers.get("Accept", ""):
# # Return an HTML page
html_response = f"""
<div class="flex-container menu">
<a href="/mtb/debug">debug</a>
<a href="/mtb/status">status</a>
</div>
"""
return web.Response(
text=endpoint.render_base_template("MTB", html_response),
content_type="text/html",
)
# Return JSON for other requests
return web.json_response({"message": "Welcome to MTB!"})
@PromptServer.instance.routes.get("/mtb/debug")
async def get_debug(request):
from . import endpoint
reload(endpoint)
enabled = False
if "MTB_DEBUG" in os.environ:
enabled = True
# Check if the request prefers HTML content
if "text/html" in request.headers.get("Accept", ""):
# # Return an HTML page
html_response = f"""
<h1>MTB Debug Status: {'Enabled' if enabled else 'Disabled'}</h1>
"""
return web.Response(
text=endpoint.render_base_template("Debug", html_response),
content_type="text/html",
)
# Return JSON for other requests
return web.json_response({"enabled": enabled})
@PromptServer.instance.routes.get("/mtb/actions")
async def no_route(request):
from . import endpoint
if "text/html" in request.headers.get("Accept", ""):
html_response = f"""
<h1>Actions has no get for now...</h1>
"""
return web.Response(
text=endpoint.render_base_template("Actions", html_response),
content_type="text/html",
)
return web.json_response({"message": "actions has no get for now"})
@PromptServer.instance.routes.post("/mtb/actions")
async def do_action(request):
from . import endpoint
reload(endpoint)
return await endpoint.do_action(request)
# - WAS Dictionary
MANIFEST = {
"name": "MTB Nodes", # The title that will be displayed on Node Class menu,. and Node Class view
"version": (0, 1, 0), # Version of the custom_node or sub module
"author": "Mel Massadian", # Author or organization of the custom_node or sub module
"project": "https://github.com/melMass/comfy_mtb", # The address that the `name` value will link to on Node Class Views
"description": "Set of nodes that enhance your animation workflow and provide a range of useful tools including features such as manipulating bounding boxes, perform color corrections, swap faces in images, interpolate frames for smooth animation, export to ProRes format, apply various image operations, work with latent spaces, generate QR codes, and create normal and height maps for textures.",
}
View File
+38
View File
@@ -0,0 +1,38 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="https://fav.farm/⚡️" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="modulepreload" href="/comfy_mtb/_app/immutable/entry/start.B_2iSefo.js">
<link rel="modulepreload" href="/comfy_mtb/_app/immutable/chunks/entry.DFosKZrm.js">
<link rel="modulepreload" href="/comfy_mtb/_app/immutable/chunks/utils.C1SWMJ6M.js">
<link rel="modulepreload" href="/comfy_mtb/_app/immutable/entry/app.DtSbs4z-.js">
<link rel="modulepreload" href="/comfy_mtb/_app/immutable/chunks/preload-helper.C56uK8e9.js">
<link rel="modulepreload" href="/comfy_mtb/_app/immutable/chunks/store.DYqNbYNW.js">
<link rel="modulepreload" href="/comfy_mtb/_app/immutable/chunks/index-client.nC1_6-Ml.js">
<link rel="modulepreload" href="/comfy_mtb/_app/immutable/chunks/this.Ju-dO593.js">
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">
<script>
{
__sveltekit_q2xodv = {
base: "/comfy_mtb",
assets: "/comfy_mtb"
};
const element = document.currentScript.parentElement;
Promise.all([
import("/comfy_mtb/_app/immutable/entry/start.B_2iSefo.js"),
import("/comfy_mtb/_app/immutable/entry/app.DtSbs4z-.js")
]).then(([kit, app]) => {
kit.start(app, element);
});
}
</script>
</div>
</body>
</html>
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
+1
View File
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
export const env={}
+1
View File
@@ -0,0 +1 @@
€export const env={}
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
.markdown-callout-title{color:var(--current-color);font-weight:700;padding:.5em;padding-inline-start:1em}.markdown-callout-content{padding:1em}.markdown-callout{--radius: 8px;--current-color: purple;border-left:3px solid var(--current-color);margin-bottom:1em;margin-top:1em}.markdown-callout-tip{--text-color: whitesmoke;--current-color: #50e3c2}.markdown-callout-note{--text-color: whitesmoke;--current-color: #0070f3}.markdown-callout-important{--text-color: whitesmoke;--current-color: #7928ca}.markdown-callout-warning{--current-color: #f5a623}.markdown-callout-caution{--current-color: #e60000}html[data-theme=light] .shiki,html[data-theme=light] .shiki>span{background-color:var(--shiki-light-bg)}html[data-theme=light] .shiki,html[data-theme=light] .shiki span{color:var(--shiki-light);font-style:var(--shiki-light-font-style);font-weight:var(--shiki-light-font-weight);-webkit-text-decoration:var(--shiki-light-text-decoration);text-decoration:var(--shiki-light-text-decoration)}html[data-theme=pastel] .shiki,html[data-theme=pastel] .shiki>span{background-color:var(--shiki-pastel-bg)}html[data-theme=pastel] .shiki,html[data-theme=pastel] .shiki span{color:var(--shiki-pastel);font-style:var(--shiki-pastel-font-style);font-weight:var(--shiki-pastel-font-weight);-webkit-text-decoration:var(--shiki-pastel-text-decoration);text-decoration:var(--shiki-pastel-text-decoration)}html[data-theme=dark] .shiki,html[data-theme=dark] .shiki>span{background-color:var(--shiki-dark-bg)}html[data-theme=dark] .shiki,html[data-theme=dark] .shiki span{color:var(--shiki-dark);font-style:var(--shiki-dark-font-style);font-weight:var(--shiki-dark-font-weight);-webkit-text-decoration:var(--shiki-dark-text-decoration);text-decoration:var(--shiki-dark-text-decoration)}pre.shiki{position:relative;z-index:1;padding:1.5rem 0;background:transparent;border-radius:.5rem}pre.shiki code{display:block;padding:0 1.5rem;transition:color .5s}.shiki.has-focused .line:not(.focused){opacity:.7;transition:filter .35s,opacity .35s;filter:blur(1.25px)}.shiki.has-focused:focus .line:not(.focused),.shiki.has-focused:hover .line:not(.focused){opacity:1;filter:blur(0)}.shiki code .diff,.shiki code .highlighted{transition:background-color .5s;margin:0 -1.5rem;padding:0 1.5rem;width:100%;display:inline-block}.shiki code .diff:before{position:absolute;left:10px}.shiki code .diff.add{background-color:#46954a26}.shiki code .diff.add:before{content:"+";color:#57ab5a}.shiki code .diff.remove{background-color:#e5534b1a;opacity:.7}.shiki code .diff.remove:before{content:"-";color:#f47067}.shiki code .highlighted{background-color:#636e7b1a!important}.shiki code .highlighted.error{background-color:#e5534b26!important}.shiki code .highlighted.warning{background-color:#ae7c1426!important}.shiki .highlighted-word{background-color:#4184e466!important;border:1px solid rgba(65,132,228,.6)!important;padding:1px 3px;margin:-1px -3px;border-radius:4px}
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
.markdown-callout-title{color:var(--current-color);font-weight:700;padding:.5em;padding-inline-start:1em}.markdown-callout-content{padding:1em}.markdown-callout{--radius: 8px;--current-color: purple;border-left:3px solid var(--current-color);margin-bottom:1em;margin-top:1em}.markdown-callout-tip{--text-color: whitesmoke;--current-color: #50e3c2}.markdown-callout-note{--text-color: whitesmoke;--current-color: #0070f3}.markdown-callout-important{--text-color: whitesmoke;--current-color: #7928ca}.markdown-callout-warning{--current-color: #f5a623}.markdown-callout-caution{--current-color: #e60000}html[data-theme=light]{.shiki,.shiki>span{background-color:var(--shiki-light-bg)}.shiki,.shiki span{color:var(--shiki-light);font-style:var(--shiki-light-font-style);font-weight:var(--shiki-light-font-weight);-webkit-text-decoration:var(--shiki-light-text-decoration);text-decoration:var(--shiki-light-text-decoration)}}html[data-theme=pastel]{.shiki,.shiki>span{background-color:var(--shiki-pastel-bg)}.shiki,.shiki span{color:var(--shiki-pastel);font-style:var(--shiki-pastel-font-style);font-weight:var(--shiki-pastel-font-weight);-webkit-text-decoration:var(--shiki-pastel-text-decoration);text-decoration:var(--shiki-pastel-text-decoration)}}html[data-theme=dark]{.shiki,.shiki>span{background-color:var(--shiki-dark-bg)}.shiki,.shiki span{color:var(--shiki-dark);font-style:var(--shiki-dark-font-style);font-weight:var(--shiki-dark-font-weight);-webkit-text-decoration:var(--shiki-dark-text-decoration);text-decoration:var(--shiki-dark-text-decoration)}}pre.shiki{position:relative;z-index:1;padding:1.5rem 0;background:transparent;border-radius:.5rem}pre.shiki code{display:block;padding:0 1.5rem;transition:color .5s}.shiki.has-focused .line:not(.focused){opacity:.7;transition:filter .35s,opacity .35s;filter:blur(1.25px)}.shiki.has-focused:focus .line:not(.focused),.shiki.has-focused:hover .line:not(.focused){opacity:1;filter:blur(0)}.shiki code .diff,.shiki code .highlighted{transition:background-color .5s;margin:0 -1.5rem;padding:0 1.5rem;width:100%;display:inline-block}.shiki code .diff:before{position:absolute;left:10px}.shiki code .diff.add{background-color:#46954a26}.shiki code .diff.add:before{content:"+";color:#57ab5a}.shiki code .diff.remove{background-color:#e5534b1a;opacity:.7}.shiki code .diff.remove:before{content:"-";color:#f47067}.shiki code .highlighted{background-color:#636e7b1a!important}.shiki code .highlighted.error{background-color:#e5534b26!important}.shiki code .highlighted.warning{background-color:#ae7c1426!important}.shiki .highlighted-word{background-color:#4184e466!important;border:1px solid rgba(65,132,228,.6)!important;padding:1px 3px;margin:-1px -3px;border-radius:4px}
Binary file not shown.
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More