Upload 18 files
Browse files- .gitattributes +3 -0
- ComfyUI/custom_nodes/ComfyUI-Anyline/.github/workflows/publish.yml +21 -0
- ComfyUI/custom_nodes/ComfyUI-Anyline/.gitignore +160 -0
- ComfyUI/custom_nodes/ComfyUI-Anyline/Anyline+MistoLine_ComfyUI_workflow.json +551 -0
- ComfyUI/custom_nodes/ComfyUI-Anyline/LICENSE +21 -0
- ComfyUI/custom_nodes/ComfyUI-Anyline/README.md +90 -0
- ComfyUI/custom_nodes/ComfyUI-Anyline/__init__.py +11 -0
- ComfyUI/custom_nodes/ComfyUI-Anyline/__pycache__/__init__.cpython-310.pyc +0 -0
- ComfyUI/custom_nodes/ComfyUI-Anyline/__pycache__/anyline.cpython-310.pyc +0 -0
- ComfyUI/custom_nodes/ComfyUI-Anyline/anyline.py +78 -0
- ComfyUI/custom_nodes/ComfyUI-Anyline/checkpoints/Anyline/.cache/huggingface/.gitignore +1 -0
- ComfyUI/custom_nodes/ComfyUI-Anyline/examples/Anyline+MistoLine_workflow.jpg +0 -0
- ComfyUI/custom_nodes/ComfyUI-Anyline/examples/TEED.png +0 -0
- ComfyUI/custom_nodes/ComfyUI-Anyline/examples/comparison.png +3 -0
- ComfyUI/custom_nodes/ComfyUI-Anyline/examples/intro.png +3 -0
- ComfyUI/custom_nodes/ComfyUI-Anyline/examples/results.png +3 -0
- ComfyUI/custom_nodes/ComfyUI-Anyline/pyproject.toml +15 -0
- ComfyUI/custom_nodes/ComfyUI-Anyline/requirements.txt +3 -0
- ComfyUI/custom_nodes/ComfyUI-Anyline/standalone_install_requirements.bat +2 -0
.gitattributes
CHANGED
@@ -33,3 +33,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
ComfyUI/custom_nodes/ComfyUI-Anyline/examples/comparison.png filter=lfs diff=lfs merge=lfs -text
|
37 |
+
ComfyUI/custom_nodes/ComfyUI-Anyline/examples/intro.png filter=lfs diff=lfs merge=lfs -text
|
38 |
+
ComfyUI/custom_nodes/ComfyUI-Anyline/examples/results.png filter=lfs diff=lfs merge=lfs -text
|
ComfyUI/custom_nodes/ComfyUI-Anyline/.github/workflows/publish.yml
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Publish to Comfy registry
|
2 |
+
on:
|
3 |
+
workflow_dispatch:
|
4 |
+
push:
|
5 |
+
branches:
|
6 |
+
- main
|
7 |
+
paths:
|
8 |
+
- "pyproject.toml"
|
9 |
+
|
10 |
+
jobs:
|
11 |
+
publish-node:
|
12 |
+
name: Publish Custom Node to registry
|
13 |
+
runs-on: ubuntu-latest
|
14 |
+
steps:
|
15 |
+
- name: Check out code
|
16 |
+
uses: actions/checkout@v4
|
17 |
+
- name: Publish Custom Node
|
18 |
+
uses: Comfy-Org/publish-node-action@main
|
19 |
+
with:
|
20 |
+
## Add your own personal access token to your Github Repository secrets and reference it here.
|
21 |
+
personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
|
ComfyUI/custom_nodes/ComfyUI-Anyline/.gitignore
ADDED
@@ -0,0 +1,160 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Byte-compiled / optimized / DLL files
|
2 |
+
__pycache__/
|
3 |
+
*.py[cod]
|
4 |
+
*$py.class
|
5 |
+
|
6 |
+
# C extensions
|
7 |
+
*.so
|
8 |
+
|
9 |
+
# Distribution / packaging
|
10 |
+
.Python
|
11 |
+
build/
|
12 |
+
develop-eggs/
|
13 |
+
dist/
|
14 |
+
downloads/
|
15 |
+
eggs/
|
16 |
+
.eggs/
|
17 |
+
lib/
|
18 |
+
lib64/
|
19 |
+
parts/
|
20 |
+
sdist/
|
21 |
+
var/
|
22 |
+
wheels/
|
23 |
+
share/python-wheels/
|
24 |
+
*.egg-info/
|
25 |
+
.installed.cfg
|
26 |
+
*.egg
|
27 |
+
MANIFEST
|
28 |
+
|
29 |
+
# PyInstaller
|
30 |
+
# Usually these files are written by a python script from a template
|
31 |
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
32 |
+
*.manifest
|
33 |
+
*.spec
|
34 |
+
|
35 |
+
# Installer logs
|
36 |
+
pip-log.txt
|
37 |
+
pip-delete-this-directory.txt
|
38 |
+
|
39 |
+
# Unit test / coverage reports
|
40 |
+
htmlcov/
|
41 |
+
.tox/
|
42 |
+
.nox/
|
43 |
+
.coverage
|
44 |
+
.coverage.*
|
45 |
+
.cache
|
46 |
+
nosetests.xml
|
47 |
+
coverage.xml
|
48 |
+
*.cover
|
49 |
+
*.py,cover
|
50 |
+
.hypothesis/
|
51 |
+
.pytest_cache/
|
52 |
+
cover/
|
53 |
+
|
54 |
+
# Translations
|
55 |
+
*.mo
|
56 |
+
*.pot
|
57 |
+
|
58 |
+
# Django stuff:
|
59 |
+
*.log
|
60 |
+
local_settings.py
|
61 |
+
db.sqlite3
|
62 |
+
db.sqlite3-journal
|
63 |
+
|
64 |
+
# Flask stuff:
|
65 |
+
instance/
|
66 |
+
.webassets-cache
|
67 |
+
|
68 |
+
# Scrapy stuff:
|
69 |
+
.scrapy
|
70 |
+
|
71 |
+
# Sphinx documentation
|
72 |
+
docs/_build/
|
73 |
+
|
74 |
+
# PyBuilder
|
75 |
+
.pybuilder/
|
76 |
+
target/
|
77 |
+
|
78 |
+
# Jupyter Notebook
|
79 |
+
.ipynb_checkpoints
|
80 |
+
|
81 |
+
# IPython
|
82 |
+
profile_default/
|
83 |
+
ipython_config.py
|
84 |
+
|
85 |
+
# pyenv
|
86 |
+
# For a library or package, you might want to ignore these files since the code is
|
87 |
+
# intended to run in multiple environments; otherwise, check them in:
|
88 |
+
# .python-version
|
89 |
+
|
90 |
+
# pipenv
|
91 |
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
92 |
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
93 |
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
94 |
+
# install all needed dependencies.
|
95 |
+
#Pipfile.lock
|
96 |
+
|
97 |
+
# poetry
|
98 |
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
99 |
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
100 |
+
# commonly ignored for libraries.
|
101 |
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
102 |
+
#poetry.lock
|
103 |
+
|
104 |
+
# pdm
|
105 |
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
106 |
+
#pdm.lock
|
107 |
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
108 |
+
# in version control.
|
109 |
+
# https://pdm.fming.dev/#use-with-ide
|
110 |
+
.pdm.toml
|
111 |
+
|
112 |
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
113 |
+
__pypackages__/
|
114 |
+
|
115 |
+
# Celery stuff
|
116 |
+
celerybeat-schedule
|
117 |
+
celerybeat.pid
|
118 |
+
|
119 |
+
# SageMath parsed files
|
120 |
+
*.sage.py
|
121 |
+
|
122 |
+
# Environments
|
123 |
+
.env
|
124 |
+
.venv
|
125 |
+
env/
|
126 |
+
venv/
|
127 |
+
ENV/
|
128 |
+
env.bak/
|
129 |
+
venv.bak/
|
130 |
+
|
131 |
+
# Spyder project settings
|
132 |
+
.spyderproject
|
133 |
+
.spyproject
|
134 |
+
|
135 |
+
# Rope project settings
|
136 |
+
.ropeproject
|
137 |
+
|
138 |
+
# mkdocs documentation
|
139 |
+
/site
|
140 |
+
|
141 |
+
# mypy
|
142 |
+
.mypy_cache/
|
143 |
+
.dmypy.json
|
144 |
+
dmypy.json
|
145 |
+
|
146 |
+
# Pyre type checker
|
147 |
+
.pyre/
|
148 |
+
|
149 |
+
# pytype static type analyzer
|
150 |
+
.pytype/
|
151 |
+
|
152 |
+
# Cython debug symbols
|
153 |
+
cython_debug/
|
154 |
+
|
155 |
+
# PyCharm
|
156 |
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
157 |
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
158 |
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
159 |
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
160 |
+
#.idea/
|
ComfyUI/custom_nodes/ComfyUI-Anyline/Anyline+MistoLine_ComfyUI_workflow.json
ADDED
@@ -0,0 +1,551 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"last_node_id": 42,
|
3 |
+
"last_link_id": 68,
|
4 |
+
"nodes": [
|
5 |
+
{
|
6 |
+
"id": 7,
|
7 |
+
"type": "CLIPTextEncode",
|
8 |
+
"pos": [404, 401],
|
9 |
+
"size": {
|
10 |
+
"0": 425.27801513671875,
|
11 |
+
"1": 180.6060791015625
|
12 |
+
},
|
13 |
+
"flags": {},
|
14 |
+
"order": 5,
|
15 |
+
"mode": 0,
|
16 |
+
"inputs": [
|
17 |
+
{
|
18 |
+
"name": "clip",
|
19 |
+
"type": "CLIP",
|
20 |
+
"link": 5
|
21 |
+
}
|
22 |
+
],
|
23 |
+
"outputs": [
|
24 |
+
{
|
25 |
+
"name": "CONDITIONING",
|
26 |
+
"type": "CONDITIONING",
|
27 |
+
"links": [13],
|
28 |
+
"slot_index": 0
|
29 |
+
}
|
30 |
+
],
|
31 |
+
"properties": {
|
32 |
+
"Node name for S&R": "CLIPTextEncode"
|
33 |
+
},
|
34 |
+
"widgets_values": [
|
35 |
+
"lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, artist name, trademark, watermark, title, multiple view, reference sheet, mutated hands and fingers, poorly drawn face, mutation, deformed, ugly, bad proportions, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck, tatoo, amateur drawing, odd eyes, uneven eyes, unnatural face, uneven nostrils, crooked mouth, bad teeth, crooked teeth, photoshop, video game, censor, censored, ghost, b&w, weird colors, gradient background, spotty background, blurry background, ugly background, simple background, realistic, out of frame, extra objects, gross, ugly, tiling, poorly drawn hands, poorly drawn feet, poorly drawn face, out of focus, blurry, very long body, duplicate, morbid, mutilated, extra fingers, mutated hands, poorly drawn eyes, cloned face, disfigured, deformed, cross-eye, extra limbs, missing limb, malformed hands, mutated, morbid, mutilated, disfigured, extra arms, extra hands, mangled fingers, contorted, conjoined, mismatched limbs, mismatched parts, bad perspective, black and white, oversaturated, undersaturated, bad shadow, cropped image, draft, grainy, pixelated"
|
36 |
+
]
|
37 |
+
},
|
38 |
+
{
|
39 |
+
"id": 25,
|
40 |
+
"type": "VAELoader",
|
41 |
+
"pos": [-203, 67],
|
42 |
+
"size": {
|
43 |
+
"0": 315,
|
44 |
+
"1": 58
|
45 |
+
},
|
46 |
+
"flags": {},
|
47 |
+
"order": 0,
|
48 |
+
"mode": 0,
|
49 |
+
"outputs": [
|
50 |
+
{
|
51 |
+
"name": "VAE",
|
52 |
+
"type": "VAE",
|
53 |
+
"links": [40],
|
54 |
+
"shape": 3,
|
55 |
+
"slot_index": 0
|
56 |
+
}
|
57 |
+
],
|
58 |
+
"properties": {
|
59 |
+
"Node name for S&R": "VAELoader"
|
60 |
+
},
|
61 |
+
"widgets_values": ["sdxl\\fixed_vae.safetensors"]
|
62 |
+
},
|
63 |
+
{
|
64 |
+
"id": 4,
|
65 |
+
"type": "CheckpointLoaderSimple",
|
66 |
+
"pos": [-206, 168],
|
67 |
+
"size": {
|
68 |
+
"0": 315,
|
69 |
+
"1": 98
|
70 |
+
},
|
71 |
+
"flags": {},
|
72 |
+
"order": 1,
|
73 |
+
"mode": 0,
|
74 |
+
"outputs": [
|
75 |
+
{
|
76 |
+
"name": "MODEL",
|
77 |
+
"type": "MODEL",
|
78 |
+
"links": [57],
|
79 |
+
"slot_index": 0
|
80 |
+
},
|
81 |
+
{
|
82 |
+
"name": "CLIP",
|
83 |
+
"type": "CLIP",
|
84 |
+
"links": [3, 5],
|
85 |
+
"slot_index": 1
|
86 |
+
},
|
87 |
+
{
|
88 |
+
"name": "VAE",
|
89 |
+
"type": "VAE",
|
90 |
+
"links": [],
|
91 |
+
"slot_index": 2
|
92 |
+
}
|
93 |
+
],
|
94 |
+
"properties": {
|
95 |
+
"Node name for S&R": "CheckpointLoaderSimple"
|
96 |
+
},
|
97 |
+
"widgets_values": ["JuggernautXL.safetensors"]
|
98 |
+
},
|
99 |
+
{
|
100 |
+
"id": 13,
|
101 |
+
"type": "ControlNetLoader",
|
102 |
+
"pos": [-300, 309],
|
103 |
+
"size": {
|
104 |
+
"0": 407.4871520996094,
|
105 |
+
"1": 58
|
106 |
+
},
|
107 |
+
"flags": {},
|
108 |
+
"order": 2,
|
109 |
+
"mode": 0,
|
110 |
+
"outputs": [
|
111 |
+
{
|
112 |
+
"name": "CONTROL_NET",
|
113 |
+
"type": "CONTROL_NET",
|
114 |
+
"links": [10],
|
115 |
+
"shape": 3,
|
116 |
+
"slot_index": 0
|
117 |
+
}
|
118 |
+
],
|
119 |
+
"properties": {
|
120 |
+
"Node name for S&R": "ControlNetLoader"
|
121 |
+
},
|
122 |
+
"widgets_values": ["sdxl\\mistoLineV2.safetensors"]
|
123 |
+
},
|
124 |
+
{
|
125 |
+
"id": 14,
|
126 |
+
"type": "ControlNetApplyAdvanced",
|
127 |
+
"pos": [524, 633],
|
128 |
+
"size": {
|
129 |
+
"0": 315,
|
130 |
+
"1": 166
|
131 |
+
},
|
132 |
+
"flags": {},
|
133 |
+
"order": 8,
|
134 |
+
"mode": 0,
|
135 |
+
"inputs": [
|
136 |
+
{
|
137 |
+
"name": "positive",
|
138 |
+
"type": "CONDITIONING",
|
139 |
+
"link": 12
|
140 |
+
},
|
141 |
+
{
|
142 |
+
"name": "negative",
|
143 |
+
"type": "CONDITIONING",
|
144 |
+
"link": 13
|
145 |
+
},
|
146 |
+
{
|
147 |
+
"name": "control_net",
|
148 |
+
"type": "CONTROL_NET",
|
149 |
+
"link": 10
|
150 |
+
},
|
151 |
+
{
|
152 |
+
"name": "image",
|
153 |
+
"type": "IMAGE",
|
154 |
+
"link": 62
|
155 |
+
}
|
156 |
+
],
|
157 |
+
"outputs": [
|
158 |
+
{
|
159 |
+
"name": "positive",
|
160 |
+
"type": "CONDITIONING",
|
161 |
+
"links": [38],
|
162 |
+
"shape": 3,
|
163 |
+
"slot_index": 0
|
164 |
+
},
|
165 |
+
{
|
166 |
+
"name": "negative",
|
167 |
+
"type": "CONDITIONING",
|
168 |
+
"links": [39],
|
169 |
+
"shape": 3,
|
170 |
+
"slot_index": 1
|
171 |
+
}
|
172 |
+
],
|
173 |
+
"properties": {
|
174 |
+
"Node name for S&R": "ControlNetApplyAdvanced"
|
175 |
+
},
|
176 |
+
"widgets_values": [1, 0, 0.9]
|
177 |
+
},
|
178 |
+
{
|
179 |
+
"id": 5,
|
180 |
+
"type": "EmptyLatentImage",
|
181 |
+
"pos": [-207, 415],
|
182 |
+
"size": [323.96075439453125, 127.00872421264648],
|
183 |
+
"flags": {},
|
184 |
+
"order": 11,
|
185 |
+
"mode": 0,
|
186 |
+
"inputs": [
|
187 |
+
{
|
188 |
+
"name": "width",
|
189 |
+
"type": "INT",
|
190 |
+
"link": 65,
|
191 |
+
"widget": {
|
192 |
+
"name": "width"
|
193 |
+
}
|
194 |
+
},
|
195 |
+
{
|
196 |
+
"name": "height",
|
197 |
+
"type": "INT",
|
198 |
+
"link": 66,
|
199 |
+
"widget": {
|
200 |
+
"name": "height"
|
201 |
+
}
|
202 |
+
}
|
203 |
+
],
|
204 |
+
"outputs": [
|
205 |
+
{
|
206 |
+
"name": "LATENT",
|
207 |
+
"type": "LATENT",
|
208 |
+
"links": [2],
|
209 |
+
"slot_index": 0
|
210 |
+
}
|
211 |
+
],
|
212 |
+
"properties": {
|
213 |
+
"Node name for S&R": "EmptyLatentImage"
|
214 |
+
},
|
215 |
+
"widgets_values": [1920, 1080, 1]
|
216 |
+
},
|
217 |
+
{
|
218 |
+
"id": 40,
|
219 |
+
"type": "GetImageSize+",
|
220 |
+
"pos": [-455, 419],
|
221 |
+
"size": {
|
222 |
+
"0": 210,
|
223 |
+
"1": 46
|
224 |
+
},
|
225 |
+
"flags": {},
|
226 |
+
"order": 10,
|
227 |
+
"mode": 0,
|
228 |
+
"inputs": [
|
229 |
+
{
|
230 |
+
"name": "image",
|
231 |
+
"type": "IMAGE",
|
232 |
+
"link": 68
|
233 |
+
}
|
234 |
+
],
|
235 |
+
"outputs": [
|
236 |
+
{
|
237 |
+
"name": "width",
|
238 |
+
"type": "INT",
|
239 |
+
"links": [65],
|
240 |
+
"shape": 3,
|
241 |
+
"slot_index": 0
|
242 |
+
},
|
243 |
+
{
|
244 |
+
"name": "height",
|
245 |
+
"type": "INT",
|
246 |
+
"links": [66],
|
247 |
+
"shape": 3,
|
248 |
+
"slot_index": 1
|
249 |
+
}
|
250 |
+
],
|
251 |
+
"properties": {
|
252 |
+
"Node name for S&R": "GetImageSize+"
|
253 |
+
}
|
254 |
+
},
|
255 |
+
{
|
256 |
+
"id": 42,
|
257 |
+
"type": "ImageResize",
|
258 |
+
"pos": [-791, 253],
|
259 |
+
"size": {
|
260 |
+
"0": 315,
|
261 |
+
"1": 246
|
262 |
+
},
|
263 |
+
"flags": {},
|
264 |
+
"order": 7,
|
265 |
+
"mode": 0,
|
266 |
+
"inputs": [
|
267 |
+
{
|
268 |
+
"name": "pixels",
|
269 |
+
"type": "IMAGE",
|
270 |
+
"link": 67
|
271 |
+
},
|
272 |
+
{
|
273 |
+
"name": "mask_optional",
|
274 |
+
"type": "MASK",
|
275 |
+
"link": null
|
276 |
+
}
|
277 |
+
],
|
278 |
+
"outputs": [
|
279 |
+
{
|
280 |
+
"name": "IMAGE",
|
281 |
+
"type": "IMAGE",
|
282 |
+
"links": [68],
|
283 |
+
"shape": 3,
|
284 |
+
"slot_index": 0
|
285 |
+
},
|
286 |
+
{
|
287 |
+
"name": "MASK",
|
288 |
+
"type": "MASK",
|
289 |
+
"links": null,
|
290 |
+
"shape": 3
|
291 |
+
}
|
292 |
+
],
|
293 |
+
"properties": {
|
294 |
+
"Node name for S&R": "ImageResize"
|
295 |
+
},
|
296 |
+
"widgets_values": [
|
297 |
+
"resize only",
|
298 |
+
0,
|
299 |
+
0,
|
300 |
+
0.9,
|
301 |
+
"reduce size only",
|
302 |
+
"4:3",
|
303 |
+
0.5,
|
304 |
+
20
|
305 |
+
]
|
306 |
+
},
|
307 |
+
{
|
308 |
+
"id": 39,
|
309 |
+
"type": "PreviewImage",
|
310 |
+
"pos": [68, 636],
|
311 |
+
"size": [401.7513596242443, 266.17120006402206],
|
312 |
+
"flags": {},
|
313 |
+
"order": 9,
|
314 |
+
"mode": 0,
|
315 |
+
"inputs": [
|
316 |
+
{
|
317 |
+
"name": "images",
|
318 |
+
"type": "IMAGE",
|
319 |
+
"link": 63
|
320 |
+
}
|
321 |
+
],
|
322 |
+
"properties": {
|
323 |
+
"Node name for S&R": "PreviewImage"
|
324 |
+
}
|
325 |
+
},
|
326 |
+
{
|
327 |
+
"id": 10,
|
328 |
+
"type": "LoadImage",
|
329 |
+
"pos": [-1154, 567],
|
330 |
+
"size": [897.3552424033633, 570.2855063814029],
|
331 |
+
"flags": {},
|
332 |
+
"order": 3,
|
333 |
+
"mode": 0,
|
334 |
+
"outputs": [
|
335 |
+
{
|
336 |
+
"name": "IMAGE",
|
337 |
+
"type": "IMAGE",
|
338 |
+
"links": [61, 67],
|
339 |
+
"shape": 3,
|
340 |
+
"slot_index": 0
|
341 |
+
},
|
342 |
+
{
|
343 |
+
"name": "MASK",
|
344 |
+
"type": "MASK",
|
345 |
+
"links": null,
|
346 |
+
"shape": 3
|
347 |
+
}
|
348 |
+
],
|
349 |
+
"properties": {
|
350 |
+
"Node name for S&R": "LoadImage"
|
351 |
+
},
|
352 |
+
"widgets_values": ["58536315 (1).jpg", "image"]
|
353 |
+
},
|
354 |
+
{
|
355 |
+
"id": 6,
|
356 |
+
"type": "CLIPTextEncode",
|
357 |
+
"pos": [415, 186],
|
358 |
+
"size": {
|
359 |
+
"0": 422.84503173828125,
|
360 |
+
"1": 164.31304931640625
|
361 |
+
},
|
362 |
+
"flags": {},
|
363 |
+
"order": 4,
|
364 |
+
"mode": 0,
|
365 |
+
"inputs": [
|
366 |
+
{
|
367 |
+
"name": "clip",
|
368 |
+
"type": "CLIP",
|
369 |
+
"link": 3
|
370 |
+
}
|
371 |
+
],
|
372 |
+
"outputs": [
|
373 |
+
{
|
374 |
+
"name": "CONDITIONING",
|
375 |
+
"type": "CONDITIONING",
|
376 |
+
"links": [12],
|
377 |
+
"slot_index": 0
|
378 |
+
}
|
379 |
+
],
|
380 |
+
"properties": {
|
381 |
+
"Node name for S&R": "CLIPTextEncode"
|
382 |
+
},
|
383 |
+
"widgets_values": [
|
384 |
+
" The image showcases a creature with a unique and intricate design. The creature has a greenish hue with a prominent, horned head. Its eyes are glowing with a yellowish hue. The creature's body is adorned with vibrant colors, including shades of blue, purple, and green. The creature's mouth is wide open, revealing sharp teeth. The background is blurred, but it seems to be a natural setting with trees and foliage. The art style appears to be fantastical, with a mix of realism and exaggeration. The Composition of this image is Master shot."
|
385 |
+
]
|
386 |
+
},
|
387 |
+
{
|
388 |
+
"id": 3,
|
389 |
+
"type": "KSampler",
|
390 |
+
"pos": [881, 196],
|
391 |
+
"size": {
|
392 |
+
"0": 315,
|
393 |
+
"1": 262
|
394 |
+
},
|
395 |
+
"flags": {},
|
396 |
+
"order": 12,
|
397 |
+
"mode": 0,
|
398 |
+
"inputs": [
|
399 |
+
{
|
400 |
+
"name": "model",
|
401 |
+
"type": "MODEL",
|
402 |
+
"link": 57
|
403 |
+
},
|
404 |
+
{
|
405 |
+
"name": "positive",
|
406 |
+
"type": "CONDITIONING",
|
407 |
+
"link": 38
|
408 |
+
},
|
409 |
+
{
|
410 |
+
"name": "negative",
|
411 |
+
"type": "CONDITIONING",
|
412 |
+
"link": 39
|
413 |
+
},
|
414 |
+
{
|
415 |
+
"name": "latent_image",
|
416 |
+
"type": "LATENT",
|
417 |
+
"link": 2
|
418 |
+
}
|
419 |
+
],
|
420 |
+
"outputs": [
|
421 |
+
{
|
422 |
+
"name": "LATENT",
|
423 |
+
"type": "LATENT",
|
424 |
+
"links": [7],
|
425 |
+
"slot_index": 0
|
426 |
+
}
|
427 |
+
],
|
428 |
+
"properties": {
|
429 |
+
"Node name for S&R": "KSampler"
|
430 |
+
},
|
431 |
+
"widgets_values": [
|
432 |
+
6883025773539,
|
433 |
+
"randomize",
|
434 |
+
30,
|
435 |
+
7,
|
436 |
+
"dpmpp_2m_sde",
|
437 |
+
"karras",
|
438 |
+
0.93
|
439 |
+
]
|
440 |
+
},
|
441 |
+
{
|
442 |
+
"id": 8,
|
443 |
+
"type": "VAEDecode",
|
444 |
+
"pos": [991, 103],
|
445 |
+
"size": {
|
446 |
+
"0": 210,
|
447 |
+
"1": 46
|
448 |
+
},
|
449 |
+
"flags": {},
|
450 |
+
"order": 13,
|
451 |
+
"mode": 0,
|
452 |
+
"inputs": [
|
453 |
+
{
|
454 |
+
"name": "samples",
|
455 |
+
"type": "LATENT",
|
456 |
+
"link": 7
|
457 |
+
},
|
458 |
+
{
|
459 |
+
"name": "vae",
|
460 |
+
"type": "VAE",
|
461 |
+
"link": 40
|
462 |
+
}
|
463 |
+
],
|
464 |
+
"outputs": [
|
465 |
+
{
|
466 |
+
"name": "IMAGE",
|
467 |
+
"type": "IMAGE",
|
468 |
+
"links": [9],
|
469 |
+
"slot_index": 0
|
470 |
+
}
|
471 |
+
],
|
472 |
+
"properties": {
|
473 |
+
"Node name for S&R": "VAEDecode"
|
474 |
+
}
|
475 |
+
},
|
476 |
+
{
|
477 |
+
"id": 9,
|
478 |
+
"type": "SaveImage",
|
479 |
+
"pos": [1233, 110],
|
480 |
+
"size": [1190.2034641024984, 1312.811532864872],
|
481 |
+
"flags": {},
|
482 |
+
"order": 14,
|
483 |
+
"mode": 0,
|
484 |
+
"inputs": [
|
485 |
+
{
|
486 |
+
"name": "images",
|
487 |
+
"type": "IMAGE",
|
488 |
+
"link": 9
|
489 |
+
}
|
490 |
+
],
|
491 |
+
"properties": {},
|
492 |
+
"widgets_values": ["mistoline"]
|
493 |
+
},
|
494 |
+
{
|
495 |
+
"id": 38,
|
496 |
+
"type": "AnyLinePreprocessor",
|
497 |
+
"pos": [-156, 598],
|
498 |
+
"size": {
|
499 |
+
"0": 210,
|
500 |
+
"1": 26
|
501 |
+
},
|
502 |
+
"flags": {},
|
503 |
+
"order": 6,
|
504 |
+
"mode": 0,
|
505 |
+
"inputs": [
|
506 |
+
{
|
507 |
+
"name": "image",
|
508 |
+
"type": "IMAGE",
|
509 |
+
"link": 61
|
510 |
+
}
|
511 |
+
],
|
512 |
+
"outputs": [
|
513 |
+
{
|
514 |
+
"name": "image",
|
515 |
+
"type": "IMAGE",
|
516 |
+
"links": [62, 63],
|
517 |
+
"shape": 3,
|
518 |
+
"slot_index": 0
|
519 |
+
}
|
520 |
+
],
|
521 |
+
"properties": {
|
522 |
+
"Node name for S&R": "AnyLinePreprocessor"
|
523 |
+
}
|
524 |
+
}
|
525 |
+
],
|
526 |
+
"links": [
|
527 |
+
[2, 5, 0, 3, 3, "LATENT"],
|
528 |
+
[3, 4, 1, 6, 0, "CLIP"],
|
529 |
+
[5, 4, 1, 7, 0, "CLIP"],
|
530 |
+
[7, 3, 0, 8, 0, "LATENT"],
|
531 |
+
[9, 8, 0, 9, 0, "IMAGE"],
|
532 |
+
[10, 13, 0, 14, 2, "CONTROL_NET"],
|
533 |
+
[12, 6, 0, 14, 0, "CONDITIONING"],
|
534 |
+
[13, 7, 0, 14, 1, "CONDITIONING"],
|
535 |
+
[38, 14, 0, 3, 1, "CONDITIONING"],
|
536 |
+
[39, 14, 1, 3, 2, "CONDITIONING"],
|
537 |
+
[40, 25, 0, 8, 1, "VAE"],
|
538 |
+
[57, 4, 0, 3, 0, "MODEL"],
|
539 |
+
[61, 10, 0, 38, 0, "IMAGE"],
|
540 |
+
[62, 38, 0, 14, 3, "IMAGE"],
|
541 |
+
[63, 38, 0, 39, 0, "IMAGE"],
|
542 |
+
[65, 40, 0, 5, 0, "INT"],
|
543 |
+
[66, 40, 1, 5, 1, "INT"],
|
544 |
+
[67, 10, 0, 42, 0, "IMAGE"],
|
545 |
+
[68, 42, 0, 40, 0, "IMAGE"]
|
546 |
+
],
|
547 |
+
"groups": [],
|
548 |
+
"config": {},
|
549 |
+
"extra": {},
|
550 |
+
"version": 0.4
|
551 |
+
}
|
ComfyUI/custom_nodes/ComfyUI-Anyline/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
MIT License
|
2 |
+
|
3 |
+
Copyright (c) 2024 TheMisto.ai(深圳混合元组科技有限公司)
|
4 |
+
|
5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 |
+
of this software and associated documentation files (the "Software"), to deal
|
7 |
+
in the Software without restriction, including without limitation the rights
|
8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9 |
+
copies of the Software, and to permit persons to whom the Software is
|
10 |
+
furnished to do so, subject to the following conditions:
|
11 |
+
|
12 |
+
The above copyright notice and this permission notice shall be included in all
|
13 |
+
copies or substantial portions of the Software.
|
14 |
+
|
15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21 |
+
SOFTWARE.
|
ComfyUI/custom_nodes/ComfyUI-Anyline/README.md
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
## Anyline
|
2 |
+
|
3 |
+
**A Fast, Accurate, and Detailed Line Detection Preprocessor**
|
4 |
+
|
5 |
+

|
6 |
+
|
7 |
+
Anyline is a ControlNet line preprocessor that accurately extracts object edges, image details, and textual content from most images. Users can input any type of image to quickly obtain line drawings with clear edges, sufficient detail preservation, and high fidelity text, which are then used as input for conditional generation in Stable Diffusion.
|
8 |
+
|
9 |
+
## Technical Details
|
10 |
+
|
11 |
+
The model and algorithms used in Anyline are based on innovative efforts stemming from the "Tiny and Efficient Model for the Edge Detection Generalization (TEED)" paper ([arXiv:2308.06468](https://arxiv.org/abs/2308.06468)). The TEED preset in ComfyUI also originates from this work, marking it as a powerful visual algorithm (TEED is currently the state-of-the-art). For more details, please refer to the paper.
|
12 |
+
|
13 |
+

|
14 |
+
|
15 |
+
## Comparison with Other Line Extraction Preprocessors
|
16 |
+
|
17 |
+
Anyline uses a processing resolution of 1280px, and hence comparisons are made at this resolution. Comparing with other commonly used line preprocessors, Anyline offers substantial advantages in contour accuracy, object details, material textures, and font recognition (especially in large scenes). It also performs better in reducing noise in most scenes, resulting in cleaner image processing with fewer inaccuracies during generation.
|
18 |
+
|
19 |
+

|
20 |
+
|
21 |
+
## Effects Overview
|
22 |
+
|
23 |
+
Anyline, in combination with the Mistoline ControlNet model, forms a complete SDXL workflow, maximizing precise control and harnessing the generative capabilities of the SDXL model. Anyline can also be used in SD1.5 workflows with SD1.5's ControlNet, although it generally performs better in the Anyline+MistoLine setup within the SDXL workflow.
|
24 |
+
|
25 |
+

|
26 |
+
|
27 |
+
**Note: The final result is highly dependent on the base model used. Please select the appropriate base model according to your needs.**
|
28 |
+
|
29 |
+
## Video Tutorial
|
30 |
+
|
31 |
+
Coming Soon!
|
32 |
+
|
33 |
+
## Installation
|
34 |
+
|
35 |
+
**To use Anyline as a ComfyUI plugin, you need to install comfyui_controlnet_aux first! You can follow the instructions here: https://github.com/Fannovel16/comfyui_controlnet_aux?tab=readme-ov-file#installation**
|
36 |
+
|
37 |
+
Once you have comfyui_controlnet_aux installed, follow these steps:
|
38 |
+
|
39 |
+
1. Open your IDE and ComfyUI command line, ensuring the Python environments match.
|
40 |
+
2. Navigate to the custom nodes directory:
|
41 |
+
```
|
42 |
+
cd custom_nodes
|
43 |
+
```
|
44 |
+
3. Clone the repository, or manually download this repository and put it in the ComfyUI/custom_nodes directory:
|
45 |
+
```
|
46 |
+
git clone https://github.com/TheMistoAI/ComfyUI-Anyline.git
|
47 |
+
```
|
48 |
+
4. Navigate to the cloned directory:
|
49 |
+
```
|
50 |
+
cd ComfyUI-Anyline
|
51 |
+
```
|
52 |
+
5. Install dependencies:
|
53 |
+
```
|
54 |
+
pip install -r requirements.txt
|
55 |
+
```
|
56 |
+
6. The model will automatically download upon first use. If this fails, manually download from [HuggingFace Repo](https://huggingface.co/TheMistoAI/MistoLine/tree/main/Anyline) and place the `.pth` file in the specified directory.
|
57 |
+
|
58 |
+
## ComfyUI Workflow
|
59 |
+
|
60 |
+
Upon installation, the Anyline preprocessor can be accessed in ComfyUI via search or right-click. The standard workflow using Anyline+Mistoline in SDXL is as follows
|
61 |
+

|
62 |
+
|
63 |
+
You can download this workflow JSON here: [ComfyUI Workflow](Anyline%2BMistoLine_ComfyUI_workflow.json)
|
64 |
+
|
65 |
+
## Use in A1111 sd-webui-controlnet
|
66 |
+
Follow instruction in https://github.com/Mikubill/sd-webui-controlnet/discussions/2907.
|
67 |
+

|
68 |
+
|
69 |
+
|
70 |
+
## Limitations and Future Development
|
71 |
+
|
72 |
+
- Anyline may encounter difficulties with images that exhibit camera-like blurs or soft focus, and may require iterations based on community feedback.
|
73 |
+
- We also plan to contact the author of ComfyUI or the developer of ComfyUI-Controlnet to integrate Anyline into ComfyUI for easier future use.
|
74 |
+
|
75 |
+
## 中国(大陆地区)便捷下载地址 (MTEED.pth):
|
76 |
+
链接:https://pan.baidu.com/s/1ik11P_u1vK8mI4q33v0MTQ?pwd=v8f1
|
77 |
+
提取码:v8f1
|
78 |
+
|
79 |
+
## Citation
|
80 |
+
|
81 |
+
```bibtex
|
82 |
+
@InProceedings{Soria_2023teed,
|
83 |
+
author = {Soria, Xavier and Li, Yachuan and Rouhani, Mohammad and Sappa, Angel D.},
|
84 |
+
title = {Tiny and Efficient Model for the Edge Detection Generalization},
|
85 |
+
booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) Workshops},
|
86 |
+
month = {October},
|
87 |
+
year = {2023},
|
88 |
+
pages = {1364-1373}
|
89 |
+
}
|
90 |
+
```
|
ComfyUI/custom_nodes/ComfyUI-Anyline/__init__.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from .anyline import AnyLine
|
2 |
+
|
3 |
+
NODE_CLASS_MAPPINGS = {
|
4 |
+
"AnyLinePreprocessor": AnyLine
|
5 |
+
}
|
6 |
+
|
7 |
+
# A dictionary that contains the friendly/humanly readable titles for the nodes
|
8 |
+
NODE_DISPLAY_NAME_MAPPINGS = {
|
9 |
+
"AnyLinePreprocessor": "TheMisto.ai Anyline"
|
10 |
+
}
|
11 |
+
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"]
|
ComfyUI/custom_nodes/ComfyUI-Anyline/__pycache__/__init__.cpython-310.pyc
ADDED
Binary file (347 Bytes). View file
|
|
ComfyUI/custom_nodes/ComfyUI-Anyline/__pycache__/anyline.cpython-310.pyc
ADDED
Binary file (3.1 kB). View file
|
|
ComfyUI/custom_nodes/ComfyUI-Anyline/anyline.py
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import torch
|
2 |
+
import numpy as np
|
3 |
+
from pathlib import Path
|
4 |
+
from huggingface_hub import hf_hub_download
|
5 |
+
from skimage import morphology
|
6 |
+
|
7 |
+
# Requires comfyui_controlnet_aux funcsions and classes
|
8 |
+
from custom_nodes.comfyui_controlnet_aux.utils import common_annotator_call
|
9 |
+
from custom_nodes.comfyui_controlnet_aux.src.custom_controlnet_aux.teed import TEDDetector
|
10 |
+
from custom_nodes.comfyui_controlnet_aux.src.custom_controlnet_aux.teed.ted import TED
|
11 |
+
from custom_nodes.comfyui_controlnet_aux.src.custom_controlnet_aux.lineart_standard import LineartStandardDetector
|
12 |
+
|
13 |
+
class AnyLine:
|
14 |
+
@classmethod
|
15 |
+
def INPUT_TYPES(s):
|
16 |
+
return {
|
17 |
+
"required": {
|
18 |
+
"image": ("IMAGE",),
|
19 |
+
},
|
20 |
+
}
|
21 |
+
|
22 |
+
RETURN_TYPES = ("IMAGE",)
|
23 |
+
RETURN_NAMES = ("image",)
|
24 |
+
|
25 |
+
FUNCTION = "get_anyline"
|
26 |
+
CATEGORY = "TheMisto/image/preprocessor"
|
27 |
+
|
28 |
+
def __init__(self):
|
29 |
+
self.device = "cpu"
|
30 |
+
|
31 |
+
def load_model(self):
|
32 |
+
subfolder = "Anyline"
|
33 |
+
checkpoint_filename = "MTEED.pth"
|
34 |
+
checkpoint_dir = Path(__file__).parent.resolve() / "checkpoints" / subfolder
|
35 |
+
checkpoint_path = checkpoint_dir / checkpoint_filename
|
36 |
+
|
37 |
+
# Download the model if it's not present
|
38 |
+
if not checkpoint_path.is_file():
|
39 |
+
print("Model not found locally, downloading from HuggingFace...")
|
40 |
+
checkpoint_dir.mkdir(parents=True, exist_ok=True)
|
41 |
+
checkpoint_path = hf_hub_download(repo_id="TheMistoAI/MistoLine", filename=checkpoint_filename, subfolder=subfolder, local_dir=checkpoint_dir)
|
42 |
+
|
43 |
+
model = TED()
|
44 |
+
model.load_state_dict(torch.load(checkpoint_path, map_location=self.device))
|
45 |
+
model.eval()
|
46 |
+
return model
|
47 |
+
|
48 |
+
def get_anyline(self, image):
|
49 |
+
# Process the image with MTEED model
|
50 |
+
mteed_model = TEDDetector(model=self.load_model()).to(self.device)
|
51 |
+
mteed_result = common_annotator_call(mteed_model, image, resolution=1280)
|
52 |
+
mteed_result = mteed_result.squeeze(0).numpy()
|
53 |
+
|
54 |
+
|
55 |
+
# Process the image with the lineart standard preprocessor
|
56 |
+
lineart_standard_detector = LineartStandardDetector()
|
57 |
+
lineart_result = common_annotator_call(lineart_standard_detector, image, guassian_sigma=2, intensity_threshold=3, resolution=1280).squeeze().numpy()
|
58 |
+
lineart_result = get_intensity_mask(lineart_result, lower_bound=0, upper_bound=1)
|
59 |
+
cleaned = morphology.remove_small_objects(lineart_result .astype(bool), min_size=36, connectivity=1)
|
60 |
+
lineart_result = lineart_result *cleaned
|
61 |
+
|
62 |
+
# Combine the results
|
63 |
+
final_result = combine_layers(mteed_result, lineart_result)
|
64 |
+
|
65 |
+
del mteed_model
|
66 |
+
return (torch.tensor(final_result).unsqueeze(0),)
|
67 |
+
|
68 |
+
def get_intensity_mask(image_array, lower_bound, upper_bound):
|
69 |
+
mask = image_array[:, :, 0]
|
70 |
+
mask = np.where((mask >= lower_bound) & (mask <= upper_bound), mask, 0)
|
71 |
+
mask = np.expand_dims(mask, 2).repeat(3, axis=2)
|
72 |
+
return mask
|
73 |
+
|
74 |
+
def combine_layers(base_layer, top_layer):
|
75 |
+
mask = top_layer.astype(bool)
|
76 |
+
temp = 1 - (1 - top_layer) * (1 - base_layer)
|
77 |
+
result = base_layer * (~mask) + temp * mask
|
78 |
+
return result
|
ComfyUI/custom_nodes/ComfyUI-Anyline/checkpoints/Anyline/.cache/huggingface/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
*
|
ComfyUI/custom_nodes/ComfyUI-Anyline/examples/Anyline+MistoLine_workflow.jpg
ADDED
![]() |
ComfyUI/custom_nodes/ComfyUI-Anyline/examples/TEED.png
ADDED
![]() |
ComfyUI/custom_nodes/ComfyUI-Anyline/examples/comparison.png
ADDED
![]() |
Git LFS Details
|
ComfyUI/custom_nodes/ComfyUI-Anyline/examples/intro.png
ADDED
![]() |
Git LFS Details
|
ComfyUI/custom_nodes/ComfyUI-Anyline/examples/results.png
ADDED
![]() |
Git LFS Details
|
ComfyUI/custom_nodes/ComfyUI-Anyline/pyproject.toml
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[project]
|
2 |
+
name = "comfyui-anyline"
|
3 |
+
description = "A Fast, Accurate, and Detailed Line Detection Preprocessor.\nAnyline is a ControlNet line preprocessor that accurately extracts object edges, image details, and textual content from most images. Users can input any type of image to quickly obtain line drawings with clear edges, sufficient detail preservation, and high fidelity text, which are then used as input for conditional generation in Stable Diffusion."
|
4 |
+
version = "1.0.0"
|
5 |
+
license = { file = "LICENSE" }
|
6 |
+
dependencies = ["pathlib", "huggingface_hub", "scikit-image"]
|
7 |
+
|
8 |
+
[project.urls]
|
9 |
+
Repository = "https://github.com/TheMistoAI/ComfyUI-Anyline"
|
10 |
+
# Used by Comfy Registry https://comfyregistry.org
|
11 |
+
|
12 |
+
[tool.comfy]
|
13 |
+
PublisherId = "themisto-ai"
|
14 |
+
DisplayName = "ComfyUI-Anyline"
|
15 |
+
Icon = ""
|
ComfyUI/custom_nodes/ComfyUI-Anyline/requirements.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
pathlib
|
2 |
+
huggingface_hub
|
3 |
+
scikit-image
|
ComfyUI/custom_nodes/ComfyUI-Anyline/standalone_install_requirements.bat
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
..\..\..\python_embeded\python.exe -s -m pip install -r requirements.txt
|
2 |
+
pause
|