updated prestartup script - better index page - changed workflows

This commit is contained in:
Andrea Pozzetti
2025-11-11 10:32:21 +00:00
parent 67e70ec0ec
commit d1b2a60823
9 changed files with 514 additions and 651 deletions
+23
View File
@@ -101,3 +101,26 @@ jobs:
destination_dir: ${{ github.run_number }}
keep_files: true
enable_jekyll: false
- name: Checkout gh-pages branch
if: always()
uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages-content
- name: Generate central index page
if: always()
run: |
mkdir -p deploy-index
python tests/generate_index_page.py gh-pages-content deploy-index/index.html ${{ github.repository }}
ls -la deploy-index/
- name: Deploy index page to root
if: always()
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./deploy-index
keep_files: true
enable_jekyll: false
+4
View File
@@ -208,3 +208,7 @@ cython_debug/
marimo/_static/
marimo/_lsp/
__marimo__/
# Local marker files (machine-specific installation state)
.flash_attn_attempted
.assets_copied
+2 -2
View File
@@ -45,12 +45,12 @@ NODE_CLASS_MAPPINGS = {
}
NODE_DISPLAY_NAME_MAPPINGS = {
"GroundingModelLoader": "Grounding Model Loader",
"GroundingModelLoader": "Grounding Model (down)Loader",
"GroundingDetector": "Grounding Detector",
"BboxVisualizer": "Bounding Box Visualizer",
"DownloadAndLoadSAM2Model": "(Down)Load SAM2Model",
"Sam2Segmentation": "Sam2 Segmentation",
"GroundingMaskModelLoader": "Grounding Mask Model Loader",
"GroundingMaskModelLoader": "Grounding Mask Model (down)Loader",
"GroundingMaskDetector": "Grounding Mask Detector",
"BatchCropAndPadFromMask": "Batch Crop and Pad From Mask",
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

-77
View File
@@ -1,14 +1,11 @@
"""
PreStartup Script for ComfyUI-Grounding
- Attempts to install flash_attn (optional dependency) on first run
- Copies example assets and workflows to ComfyUI directories on first run
"""
import os
import shutil
import subprocess
import sys
from pathlib import Path
# Import folder_paths from ComfyUI
try:
@@ -28,11 +25,6 @@ def get_marker_file():
return os.path.join(get_node_dir(), ".assets_copied")
def get_flash_attn_marker():
"""Get path to marker file that tracks if flash_attn installation was attempted"""
return os.path.join(get_node_dir(), ".flash_attn_attempted")
def has_assets_been_copied():
"""Check if assets have already been copied"""
return os.path.exists(get_marker_file())
@@ -47,72 +39,6 @@ def mark_assets_as_copied():
print(f"[ComfyUI-Grounding] Warning: Could not create marker file: {e}")
def mark_flash_attn_attempted(success):
"""Create marker file to indicate flash_attn installation was attempted"""
try:
with open(get_flash_attn_marker(), 'w') as f:
if success:
f.write("flash_attn installed successfully\n")
else:
f.write("flash_attn installation failed (optional)\n")
except Exception as e:
print(f"[ComfyUI-Grounding] Warning: Could not create flash_attn marker: {e}")
def try_install_flash_attn():
"""
Attempt to install flash_attn (optional dependency for faster inference).
Only runs once - uses marker file to track attempts.
"""
# Check if already attempted
if os.path.exists(get_flash_attn_marker()):
return True # Already attempted, skip
print("[ComfyUI-Grounding] Checking for flash_attn...")
# Check if already installed
try:
import flash_attn
print("[ComfyUI-Grounding] ✅ flash_attn already installed")
mark_flash_attn_attempted(True)
return True
except ImportError:
pass
print("[ComfyUI-Grounding] Attempting to install flash_attn (optional)...")
print("[ComfyUI-Grounding] Note: This may take 5-10 minutes and requires CUDA GPU")
try:
result = subprocess.run(
[sys.executable, "-m", "pip", "install", "flash-attn", "--prefer-binary"],
capture_output=True,
text=True,
timeout=300 # 5 minute timeout
)
if result.returncode == 0:
print("[ComfyUI-Grounding] ✅ flash_attn installed successfully")
print("[ComfyUI-Grounding] Florence-2 and SA2VA will use faster inference")
mark_flash_attn_attempted(True)
return True
else:
print("[ComfyUI-Grounding] ⚠️ flash_attn installation failed")
print("[ComfyUI-Grounding] This is optional - nodes will work without it")
mark_flash_attn_attempted(False)
return False
except subprocess.TimeoutExpired:
print("[ComfyUI-Grounding] ⚠️ flash_attn installation timed out")
print("[ComfyUI-Grounding] Continuing without it (nodes will still work)")
mark_flash_attn_attempted(False)
return False
except Exception as e:
print(f"[ComfyUI-Grounding] ⚠️ flash_attn installation error: {e}")
print("[ComfyUI-Grounding] Continuing without flash_attn")
mark_flash_attn_attempted(False)
return False
def copy_assets():
"""Copy example assets recursively to ComfyUI input directory"""
node_dir = get_node_dir()
@@ -254,9 +180,6 @@ def main():
"""Main initialization function"""
print("[ComfyUI-Grounding] PreStartup Script Running...")
# Try to install flash_attn (optional, only on first run)
try_install_flash_attn()
# Copy assets and workflows (skips files that already exist)
print("[ComfyUI-Grounding] Checking assets and workflows...")
assets_ok = copy_assets()
+1 -2
View File
@@ -9,7 +9,6 @@ einops>=0.6.0 # Required by Florence-2 and SA2VA model architectures
ultralytics>=8.2.0
hf_transfer
peft
# flash_attn # Optional - improves SA2VA performance but not required
# Image processing (usually already installed with ComfyUI)
# pillow>=10.0.0
@@ -26,4 +25,4 @@ tqdm>=4.65.0
torch<=2.8.0
torchvision
torchaudio
# flash_attn # Optional - improves SA2VA inference speed but not required
flash_attn
+335
View File
@@ -0,0 +1,335 @@
#!/usr/bin/env python3
"""
Generate central landing page for all test runs
"""
import os
import json
import re
from pathlib import Path
from datetime import datetime, timezone
def scan_gh_pages_runs(gh_pages_dir):
"""Scan gh-pages directory for all run directories and extract metadata"""
gh_pages_path = Path(gh_pages_dir)
if not gh_pages_path.exists():
print(f"Warning: {gh_pages_dir} does not exist")
return []
runs = []
# Find all directories that are numeric (run numbers)
for item in gh_pages_path.iterdir():
if item.is_dir() and item.name.isdigit():
run_number = int(item.name)
# Count PNG images
png_files = list(item.glob("*.png"))
image_count = len(png_files)
# Try to get timestamp from index.html if it exists
index_file = item / "index.html"
timestamp = None
if index_file.exists():
try:
content = index_file.read_text()
# Extract timestamp from "Generated: YYYY-MM-DD HH:MM:SS UTC"
match = re.search(r'Generated: ([\d\-: ]+) UTC', content)
if match:
timestamp = match.group(1)
except Exception as e:
print(f"Warning: Could not read timestamp from {index_file}: {e}")
# If no timestamp found, use directory modification time
if not timestamp:
mtime = item.stat().st_mtime
timestamp = datetime.fromtimestamp(mtime).strftime("%Y-%m-%d %H:%M:%S")
runs.append({
"run_number": run_number,
"timestamp": timestamp,
"image_count": image_count,
"has_gallery": index_file.exists()
})
# Sort by run number (descending - newest first)
runs.sort(key=lambda x: x["run_number"], reverse=True)
return runs
def generate_index_html(runs, output_file, repo_name="ComfyUI-Grounding"):
"""Generate the central landing page HTML"""
total_images = sum(run["image_count"] for run in runs)
html = f"""<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ComfyUI-Grounding Test Results</title>
<style>
* {{
margin: 0;
padding: 0;
box-sizing: border-box;
}}
body {{
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
background: #0d1117;
color: #c9d1d9;
padding: 2rem;
line-height: 1.6;
}}
.container {{
max-width: 1200px;
margin: 0 auto;
}}
h1 {{
font-size: 2.5rem;
margin-bottom: 0.5rem;
color: #58a6ff;
}}
.subtitle {{
color: #8b949e;
margin-bottom: 2rem;
font-size: 1.1rem;
}}
.stats-grid {{
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1rem;
margin-bottom: 2rem;
}}
.stat-card {{
background: #161b22;
border: 1px solid #30363d;
border-radius: 6px;
padding: 1.5rem;
text-align: center;
}}
.stat-value {{
font-size: 2.5rem;
font-weight: 700;
color: #58a6ff;
display: block;
}}
.stat-label {{
color: #8b949e;
font-size: 0.9rem;
margin-top: 0.5rem;
}}
.runs-section {{
margin-top: 3rem;
}}
.section-title {{
font-size: 1.5rem;
margin-bottom: 1.5rem;
color: #c9d1d9;
border-bottom: 1px solid #30363d;
padding-bottom: 0.5rem;
}}
.runs-grid {{
display: grid;
gap: 1rem;
}}
.run-card {{
background: #161b22;
border: 1px solid #30363d;
border-radius: 6px;
padding: 1.5rem;
display: grid;
grid-template-columns: auto 1fr auto auto;
gap: 1.5rem;
align-items: center;
transition: all 0.2s;
text-decoration: none;
color: inherit;
}}
.run-card:hover {{
transform: translateX(4px);
border-color: #58a6ff;
box-shadow: 0 4px 12px rgba(88, 166, 255, 0.1);
}}
.run-number {{
font-size: 1.8rem;
font-weight: 700;
color: #58a6ff;
min-width: 80px;
}}
.run-info {{
display: flex;
flex-direction: column;
gap: 0.3rem;
}}
.run-timestamp {{
color: #8b949e;
font-size: 0.9rem;
}}
.run-images {{
color: #c9d1d9;
font-size: 0.9rem;
}}
.run-badge {{
background: #238636;
color: #fff;
padding: 0.3rem 0.8rem;
border-radius: 20px;
font-size: 0.8rem;
font-weight: 500;
}}
.run-badge.latest {{
background: #1f6feb;
}}
.view-link {{
color: #58a6ff;
text-decoration: none;
font-weight: 500;
padding: 0.5rem 1rem;
border: 1px solid #58a6ff;
border-radius: 6px;
transition: all 0.2s;
}}
.view-link:hover {{
background: #58a6ff;
color: #0d1117;
}}
.empty-state {{
text-align: center;
padding: 4rem 2rem;
color: #8b949e;
}}
.empty-state-icon {{
font-size: 4rem;
margin-bottom: 1rem;
}}
footer {{
margin-top: 4rem;
padding-top: 2rem;
border-top: 1px solid #30363d;
text-align: center;
color: #8b949e;
font-size: 0.9rem;
}}
footer a {{
color: #58a6ff;
text-decoration: none;
}}
footer a:hover {{
text-decoration: underline;
}}
@media (max-width: 768px) {{
.run-card {{
grid-template-columns: 1fr;
gap: 1rem;
}}
.run-number {{
font-size: 1.5rem;
}}
}}
</style>
</head>
<body>
<div class="container">
<h1>🧪 Test Results Gallery</h1>
<p class="subtitle">Visual outputs from ComfyUI-Grounding automated tests</p>
<div class="stats-grid">
<div class="stat-card">
<span class="stat-value">{len(runs)}</span>
<div class="stat-label">Test Runs</div>
</div>
<div class="stat-card">
<span class="stat-value">{total_images}</span>
<div class="stat-label">Total Images</div>
</div>
<div class="stat-card">
<span class="stat-value">{runs[0]['image_count'] if runs else 0}</span>
<div class="stat-label">Latest Run Images</div>
</div>
</div>
<div class="runs-section">
<h2 class="section-title">All Test Runs</h2>
"""
if runs:
html += ' <div class="runs-grid">\n'
for idx, run in enumerate(runs):
is_latest = idx == 0
badge = '<span class="run-badge latest">Latest</span>' if is_latest else ''
if not run["has_gallery"]:
continue
html += f"""
<a href="./{run['run_number']}/" class="run-card">
<div class="run-number">#{run['run_number']}</div>
<div class="run-info">
<div class="run-timestamp">📅 {run['timestamp']}</div>
<div class="run-images">🖼️ {run['image_count']} image{'s' if run['image_count'] != 1 else ''}</div>
</div>
{badge}
<div class="view-link">View Gallery →</div>
</a>
"""
html += ' </div>\n'
else:
html += """
<div class="empty-state">
<div class="empty-state-icon">📭</div>
<p>No test runs found yet. Check back after the first workflow execution!</p>
</div>
"""
html += f"""
</div>
<footer>
<p>
Generated automatically by
<a href="https://github.com/{repo_name}" target="_blank">ComfyUI-Grounding</a>
CI/CD pipeline
</p>
<p style="margin-top: 0.5rem;">
Last updated: {datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S UTC")}
</p>
</footer>
</div>
</body>
</html>
"""
# Write the HTML file
output_path = Path(output_file)
output_path.write_text(html)
print(f"✅ Generated index page at {output_path}")
print(f"📊 {len(runs)} runs listed")
print(f"🖼️ {total_images} total images")
def main():
import sys
if len(sys.argv) < 2:
print("Usage: python generate_index_page.py <gh-pages-dir> [output-file] [repo-name]")
print("Example: python generate_index_page.py ./gh-pages index.html ComfyUI-Grounding")
sys.exit(1)
gh_pages_dir = sys.argv[1]
output_file = sys.argv[2] if len(sys.argv) > 2 else "index.html"
repo_name = sys.argv[3] if len(sys.argv) > 3 else "ComfyUI-Grounding"
print(f"🔍 Scanning {gh_pages_dir} for test runs...")
runs = scan_gh_pages_runs(gh_pages_dir)
print(f"📝 Generating index page...")
generate_index_html(runs, output_file, repo_name)
if __name__ == "__main__":
main()
+105 -265
View File
@@ -1,58 +1,59 @@
{
"id": "38945c5c-4e77-4d6c-b916-6a2f0a1b6a89",
"revision": 0,
"last_node_id": 32,
"last_link_id": 39,
"last_node_id": 36,
"last_link_id": 44,
"nodes": [
{
"id": 28,
"type": "InvertMask",
"id": 33,
"type": "LoadImage",
"pos": [
98.71468314873522,
-76.55255233775446
-303.3027379792829,
92.61863567718751
],
"size": [
140,
26
274.080078125,
314
],
"flags": {},
"order": 3,
"order": 0,
"mode": 0,
"inputs": [
{
"name": "mask",
"type": "MASK",
"link": 33
}
],
"inputs": [],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
42
]
},
{
"name": "MASK",
"type": "MASK",
"links": [
34
]
"links": null
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.67",
"Node name for S&R": "InvertMask"
}
"Node name for S&R": "LoadImage"
},
"widgets_values": [
"brekkie.jpg",
"image"
]
},
{
"id": 31,
"type": "PreviewAny",
"pos": [
110.50039305540561,
281.573065740487
580.0735093941091,
291.1285668669379
],
"size": [
140,
76
210,
88
],
"flags": {},
"order": 5,
"order": 4,
"mode": 0,
"inputs": [
{
@@ -63,9 +64,9 @@
],
"outputs": [],
"properties": {
"Node name for S&R": "PreviewAny",
"cnr_id": "comfy-core",
"ver": "0.3.67",
"Node name for S&R": "PreviewAny"
"ver": "0.3.67"
},
"widgets_values": []
},
@@ -73,15 +74,15 @@
"id": 29,
"type": "PreviewImage",
"pos": [
533.6126667407317,
103.92480629195937
564.3432225749335,
-58.75360697114505
],
"size": [
279.1381383513526,
299.2129823737602
],
"flags": {},
"order": 4,
"order": 3,
"mode": 0,
"inputs": [
{
@@ -92,202 +93,12 @@
],
"outputs": [],
"properties": {
"Node name for S&R": "PreviewImage",
"cnr_id": "comfy-core",
"ver": "0.3.67",
"Node name for S&R": "PreviewImage"
"ver": "0.3.67"
},
"widgets_values": []
},
{
"id": 30,
"type": "PreviewImage",
"pos": [
532.7368358026316,
-228.9107803208185
],
"size": [
289.0763407319919,
290.26959173790755
],
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 36
}
],
"outputs": [],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.67",
"Node name for S&R": "PreviewImage"
},
"widgets_values": []
},
{
"id": 32,
"type": "LoadImagesFromFolderKJ",
"pos": [
-309.5514298801789,
161.68998793772164
],
"size": [
290.5201171875,
262
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": [
38,
39
]
},
{
"name": "mask",
"type": "MASK",
"links": null
},
{
"name": "count",
"type": "INT",
"links": null
},
{
"name": "image_path",
"type": "STRING",
"links": null
}
],
"properties": {
"cnr_id": "comfyui-kjnodes",
"ver": "1.1.9",
"Node name for S&R": "LoadImagesFromFolderKJ"
},
"widgets_values": [
"input/tobatch",
1024,
1024,
"pad",
0,
0,
false
]
},
{
"id": 26,
"type": "JoinImageWithAlpha",
"pos": [
259.332162129211,
-105.19057150244885
],
"size": [
176.86484375,
46
],
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"name": "image",
"type": "IMAGE",
"link": 39
},
{
"name": "alpha",
"type": "MASK",
"link": 34
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
36
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.67",
"Node name for S&R": "JoinImageWithAlpha"
}
},
{
"id": 19,
"type": "GroundingMaskDetector",
"pos": [
106.9620845129382,
-14.471635853967237
],
"size": [
400,
248
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MASK_MODEL",
"link": 21
},
{
"name": "image",
"type": "IMAGE",
"link": 38
}
],
"outputs": [
{
"name": "masks",
"type": "MASK",
"links": [
33
]
},
{
"name": "overlaid_mask",
"type": "IMAGE",
"links": [
35
]
},
{
"name": "text",
"type": "STRING",
"links": [
37
]
}
],
"properties": {
"aux_id": "PozzettiAndrea/ComfyUI-Grounding",
"ver": "a947f4961c39cc150a98738fa83a0494e52f3de0",
"Node name for S&R": "GroundingMaskDetector"
},
"widgets_values": [
"segment the main object in the image.",
0.3,
1024,
3,
2048,
1,
42,
"fixed"
]
},
{
"id": 18,
"type": "GroundingMaskModelLoader",
@@ -313,14 +124,75 @@
}
],
"properties": {
"Node name for S&R": "GroundingMaskModelLoader",
"aux_id": "PozzettiAndrea/ComfyUI-Grounding",
"ver": "a947f4961c39cc150a98738fa83a0494e52f3de0",
"Node name for S&R": "GroundingMaskModelLoader"
"ver": "a947f4961c39cc150a98738fa83a0494e52f3de0"
},
"widgets_values": [
"SA2VA: 1B",
"SA2VA: 4B",
"bf16"
]
},
{
"id": 19,
"type": "GroundingMaskDetector",
"pos": [
106.9620845129382,
-14.471635853967237
],
"size": [
400,
248
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MASK_MODEL",
"link": 21
},
{
"name": "image",
"type": "IMAGE",
"link": 42
}
],
"outputs": [
{
"name": "masks",
"type": "MASK",
"links": []
},
{
"name": "overlaid_mask",
"type": "IMAGE",
"links": [
35
]
},
{
"name": "text",
"type": "STRING",
"links": [
37
]
}
],
"properties": {
"Node name for S&R": "GroundingMaskDetector",
"aux_id": "PozzettiAndrea/ComfyUI-Grounding",
"ver": "a947f4961c39cc150a98738fa83a0494e52f3de0"
},
"widgets_values": [
"Segment the food with the most vitamin C",
0.3,
2048,
1,
42,
"fixed"
]
}
],
"links": [
@@ -332,22 +204,6 @@
0,
"MASK_MODEL"
],
[
33,
19,
0,
28,
0,
"MASK"
],
[
34,
28,
0,
26,
1,
"MASK"
],
[
35,
19,
@@ -356,14 +212,6 @@
0,
"IMAGE"
],
[
36,
26,
0,
30,
0,
"IMAGE"
],
[
37,
19,
@@ -373,30 +221,22 @@
"*"
],
[
38,
32,
42,
33,
0,
19,
1,
"IMAGE"
],
[
39,
32,
0,
26,
0,
"IMAGE"
]
],
"groups": [],
"config": {},
"extra": {
"ds": {
"scale": 1.2894499156462411,
"scale": 1.0656610873109524,
"offset": [
386.94731260454324,
226.3186553038392
315.358950162618,
142.88899383901187
]
},
"frontendVersion": "1.28.8"
+44 -305
View File
@@ -1,8 +1,8 @@
{
"id": "23662dd8-0bfd-4ab0-833e-1775efda6729",
"revision": 0,
"last_node_id": 17,
"last_link_id": 19,
"last_node_id": 19,
"last_link_id": 21,
"nodes": [
{
"id": 3,
@@ -13,7 +13,7 @@
],
"size": [
270,
82
58
],
"flags": {},
"order": 0,
@@ -29,163 +29,49 @@
}
],
"properties": {
"Node name for S&R": "GroundingModelLoader",
"aux_id": "PozzettiAndrea/ComfyUI-Grounding",
"ver": "a947f4961c39cc150a98738fa83a0494e52f3de0",
"Node name for S&R": "GroundingModelLoader"
"ver": "a947f4961c39cc150a98738fa83a0494e52f3de0"
},
"widgets_values": [
"Florence-2: Large (0.77B params)",
"eager"
"Florence-2: Large (0.77B params)"
]
},
{
"id": 12,
"type": "DownloadAndLoadSAM2Model",
"id": 18,
"type": "LoadImage",
"pos": [
134.1244248881893,
-152.4815917189195
-361.5061512509591,
112.76113420046104
],
"size": [
270,
130
274.080078125,
314
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "sam2_model",
"type": "SAM2MODEL",
"links": [
10
]
}
],
"properties": {
"aux_id": "PozzettiAndrea/ComfyUI-Grounding",
"ver": "a947f4961c39cc150a98738fa83a0494e52f3de0",
"Node name for S&R": "DownloadAndLoadSAM2Model"
},
"widgets_values": [
"sam2.1_hiera_large.safetensors",
"single_image",
"cuda",
"fp16"
]
},
{
"id": 14,
"type": "JoinImageWithAlpha",
"pos": [
806.4560194385198,
47.17325913006609
],
"size": [
176.86484375,
46
],
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"name": "image",
"type": "IMAGE",
"link": 13
},
{
"name": "alpha",
"type": "MASK",
"link": 17
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
19
20
]
},
{
"name": "MASK",
"type": "MASK",
"links": null
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.67",
"Node name for S&R": "JoinImageWithAlpha"
},
"widgets_values": []
},
{
"id": 11,
"type": "Sam2Segmentation",
"pos": [
507.4435292430558,
34.683721146105555
],
"size": [
272.087890625,
254
],
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "sam2_model",
"type": "SAM2MODEL",
"link": 10
},
{
"name": "image",
"type": "IMAGE",
"link": 11
},
{
"name": "coordinates_positive",
"shape": 7,
"type": "STRING",
"link": null
},
{
"name": "coordinates_negative",
"shape": 7,
"type": "STRING",
"link": null
},
{
"name": "bboxes",
"shape": 7,
"type": "BBOX",
"link": 12
},
{
"name": "mask",
"shape": 7,
"type": "MASK",
"link": null
}
],
"outputs": [
{
"name": "mask",
"type": "MASK",
"links": [
16
]
}
],
"properties": {
"aux_id": "PozzettiAndrea/ComfyUI-Grounding",
"ver": "a947f4961c39cc150a98738fa83a0494e52f3de0",
"Node name for S&R": "Sam2Segmentation"
"Node name for S&R": "LoadImage"
},
"widgets_values": [
false,
false,
0,
0,
0
"plantpot.png",
"image"
]
},
{
@@ -197,10 +83,10 @@
],
"size": [
400,
364
340
],
"flags": {},
"order": 3,
"order": 2,
"mode": 0,
"inputs": [
{
@@ -211,21 +97,21 @@
{
"name": "image",
"type": "IMAGE",
"link": 8
"link": 20
}
],
"outputs": [
{
"name": "bboxes",
"type": "BBOX",
"links": [
12
]
"links": []
},
{
"name": "annotated_image",
"type": "IMAGE",
"links": []
"links": [
21
]
},
{
"name": "labels",
@@ -239,144 +125,45 @@
}
],
"properties": {
"Node name for S&R": "GroundingDetector",
"aux_id": "PozzettiAndrea/ComfyUI-Grounding",
"ver": "a947f4961c39cc150a98738fa83a0494e52f3de0",
"Node name for S&R": "GroundingDetector"
"ver": "a947f4961c39cc150a98738fa83a0494e52f3de0"
},
"widgets_values": [
"main object",
"plant. watering can",
0.3,
false,
true,
"list_only",
0.25,
1024,
3,
0.45,
false,
300,
42,
"fixed"
]
},
{
"id": 15,
"type": "InvertMask",
"pos": [
634.4085072101292,
-31.37835895949953
],
"size": [
140,
26
],
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"name": "mask",
"type": "MASK",
"link": 16
}
],
"outputs": [
{
"name": "MASK",
"type": "MASK",
"links": [
17
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.67",
"Node name for S&R": "InvertMask"
},
"widgets_values": []
},
{
"id": 9,
"type": "LoadImagesFromFolderKJ",
"pos": [
-319.8692780804565,
159.9365003928532
],
"size": [
290.5201171875,
262
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "image",
"type": "IMAGE",
"links": [
8,
11,
13
]
},
{
"name": "mask",
"type": "MASK",
"links": null
},
{
"name": "count",
"type": "INT",
"links": null
},
{
"name": "image_path",
"type": "STRING",
"links": null
}
],
"properties": {
"cnr_id": "comfyui-kjnodes",
"ver": "1.1.9",
"Node name for S&R": "LoadImagesFromFolderKJ"
},
"widgets_values": [
"input/tobatch",
1024,
1024,
"pad",
0,
0,
false
]
},
{
"id": 17,
"id": 19,
"type": "PreviewImage",
"pos": [
1001.6651677560029,
55.417983277011885
530.6472534980396,
42.682752634548045
],
"size": [
330.90445054815405,
258
339.1799683347449,
401.7374663149234
],
"flags": {},
"order": 7,
"order": 3,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 19
"link": 21
}
],
"outputs": [],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.67",
"Node name for S&R": "PreviewImage"
},
"widgets_values": []
@@ -392,66 +179,18 @@
"GROUNDING_MODEL"
],
[
8,
9,
20,
18,
0,
1,
1,
"IMAGE"
],
[
10,
12,
0,
11,
0,
"SAM2MODEL"
],
[
11,
9,
0,
11,
21,
1,
"IMAGE"
],
[
12,
1,
0,
11,
4,
"BBOX"
],
[
13,
9,
0,
14,
0,
"IMAGE"
],
[
16,
11,
0,
15,
0,
"MASK"
],
[
17,
15,
0,
14,
1,
"MASK"
],
[
19,
14,
0,
17,
0,
"IMAGE"
]
@@ -460,10 +199,10 @@
"config": {},
"extra": {
"ds": {
"scale": 0.9278994587027772,
"scale": 0.8435449624570703,
"offset": [
508.01216790085954,
282.0476732486773
425.7123038653443,
180.08680307006819
]
},
"frontendVersion": "1.28.8"