Comfy-Org / Comfy-Org/ComfyUI

tag parentheses causes split? even with escape or quotes?

Open
#10,782 0 comments 1 reaction 0 assignees View on GitHub
Potential Bug
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

### Custom Node Testing

- [x] I have tried disabling custom nodes and the issue persists (see [how to disable custom nodes](https://docs.comfy.org/troubleshooting/custom-node-issues#step-1%3A-test-with-all-custom-nodes-disabled) if you need help)

### Expected Behavior

When using a tag like `tracer_(overwatch)` i expect there to be some way to weight the whole tag same.
Sorry if I am doing something wrong, or known issue.
Thanks for help.

### Actual Behavior

but with escape `tracer_\(overwatch\)`

```
0. 'tracer_\' (weight: 1.00)
1. 'overwatch\' (weight: 1.10)
```

or without escape `tracer_(overwatch)`

```
0. 'tracer_' (weight: 1.00)
1. 'overwatch' (weight: 1.10)
```

it is split and weighted differently? am i doing something wrong? if escape not for this? then what?

### Steps to Reproduce

```
import comfy.sd1_clip as sd1_clip

class DebugPromptParse:
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"text": ("STRING", {"multiline": True, "default": ""}),
}
}

RETURN_TYPES = ("STRING", "STRING")
RETURN_NAMES = ("original", "parsed")
FUNCTION = "parse"
CATEGORY = "utils"

def parse(self, text):
try:
weights = sd1_clip.token_weights(text, 1.0)
parsed_text = self.format_output(weights)
except Exception as e:
parsed_text = f"Parse error: {str(e)}"

return (text, parsed_text)

def format_output(self, weights):
if not weights:
return "Empty prompt"

lines = []
for i, item in enumerate(weights):
if isinstance(item, tuple):
token, weight = item
weight_str = f"{weight:.2f}" if isinstance(weight, float) else str(weight)
lines.append(f"{i:2d}. '{token}' (weight: {weight_str})")
else:
lines.append(f"{i:2d}. '{item}' (weight: 1.00)")

return "\n".join(lines)

NODE_CLASS_MAPPINGS = {
"DebugPromptParse": DebugPromptParse
}

NODE_DISPLAY_NAME_MAPPINGS = {
"DebugPromptParse": "⚙️DebugPromptParse"
}
```

### Debug Logs

```powershell
[START] Security scan
[ComfyUI-Manager] Using uv as Python module for pip operations.
[DONE] Security scan
## ComfyUI-Manager: installing dependencies done.
** ComfyUI startup time: 2025-11-17 22:51:01.366
** Platform: Linux
** Python version: 3.12.3 (main, Aug 14 2025, 17:47:21) [GCC 13.3.0]
** Python executable: /mnt/data/code/ComfyUI/.venv/bin/python3
** ComfyUI Path: /mnt/data/code/ComfyUI
** ComfyUI Base Folder Path: /mnt/data/code/ComfyUI
** User directory: /mnt/data/code/ComfyUI/user
** ComfyUI-Manager config path: /mnt/data/code/ComfyUI/user/default/ComfyUI-Manager/config.ini
** Log path: /mnt/data/code/ComfyUI/user/comfyui.log

Prestartup times for custom nodes:
0.0 seconds: /mnt/data/code/ComfyUI/custom_nodes/ComfyUI-Easy-Use
0.3 seconds: /mnt/data/code/ComfyUI/custom_nodes/comfyui-manager

Checkpoint files will always be loaded safely.
Total VRAM 8176 MB, total RAM 31908 MB
pytorch version: 2.10.0.dev20251016+rocm7.0
AMD arch: gfx1030
ROCm version: (7, 0)
Set vram state to: NORMAL_VRAM
Device: cuda:0 AMD Radeon RX 6600 : native
Using sub quadratic optimization for attention, if you have memory or speed issues try using: --use-split-cross-attention
Python version: 3.12.3 (main, Aug 14 2025, 17:47:21) [GCC 13.3.0]
ComfyUI version: 0.3.68
ComfyUI frontend version: 1.28.8
[Prompt Server] web root: /mnt/data/code/ComfyUI/.venv/lib/python3.12/site-packages/comfyui_frontend_package/static
### Loading: ComfyUI-Manager (V3.37.1)
[ComfyUI-Manager] network_mode: public
### ComfyUI Revision: 4177 [265adad8] *DETACHED | Released on '2025-11-04'
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/github-stats.json
[ComfyUI-Easy-Use] server: v1.3.4 Loaded
[ComfyUI-Easy-Use] web root: /mnt/data/code/ComfyUI/custom_nodes/ComfyUI-Easy-Use/web_version/v2 Loaded

Import times for custom nodes:
0.0 seconds: /mnt/data/code/ComfyUI/custom_nodes/⚙️LoadJSON.py
0.0 seconds: /mnt/data/code/ComfyUI/custom_nodes/⚙️RandomAestheticFashion.py
0.0 seconds: /mnt/data/code/ComfyUI/custom_nodes/websocket_image_save.py
0.0 seconds: /mnt/data/code/ComfyUI/custom_nodes/⚙️DebugPromptParse.py
0.0 seconds: /mnt/data/code/ComfyUI/custom_nodes/text-node-with-comments
0.0 seconds: /mnt/data/code/ComfyUI/custom_nodes/⚙️DynamicString.py
0.0 seconds: /mnt/data/code/ComfyUI/custom_nodes/comfyui-autocomplete-plus
0.0 seconds: /mnt/data/code/ComfyUI/custom_nodes/ComfyUI_ResolutionSelector
0.0 seconds: /mnt/data/code/ComfyUI/custom_nodes/ComfyUI-Notifications
0.0 seconds: /mnt/data/code/ComfyUI/custom_nodes/efficiency-nodes-comfyui
0.0 seconds: /mnt/data/code/ComfyUI/custom_nodes/comfyui_image_metadata_extension
0.0 seconds: /mnt/data/code/ComfyUI/custom_nodes/ComfyUI-Model-Manager
0.1 seconds: /mnt/data/code/ComfyUI/custom_nodes/comfyui-manager
0.6 seconds: /mnt/data/code/ComfyUI/custom_nodes/ComfyUI-Easy-Use

Context impl SQLiteImpl.
Will assume non-transactional DDL.
No target revision found.
Starting server

To see the GUI go to: http://127.0.0.1:8188
FETCH ComfyRegistry Data: 5/106
FETCH ComfyRegistry Data: 10/106
FETCH ComfyRegistry Data: 15/106
[DEPRECATION WARNING] Detected import of deprecated legacy API: /scripts/ui.js. This is likely caused by a custom node extension using outdated APIs. Please update your extensions or contact the extension author for an updated version.
[DEPRECATION WARNING] Detected import of deprecated legacy API: /extensions/core/groupNode.js. This is likely caused by a custom node extension using outdated APIs. Please update your extensions or contact the extension author for an updated version.
FETCH ComfyRegistry Data: 20/106
[DEPRECATION WARNING] Detected import of deprecated legacy API: /scripts/ui/components/buttonGroup.js. This is likely caused by a custom node extension using outdated APIs. Please update your extensions or contact the extension author for an updated version.
[Autocomplete-Plus] CSV file status:
* Danbooru -> base: True, extra: []
* E621 -> base: False, extra: []
[DEPRECATION WARNING] Detected import of deprecated legacy API: /scripts/ui/components/button.js. This is likely caused by a custom node extension using outdated APIs. Please update your extensions or contact the extension author for an updated version.
FETCH ComfyRegistry Data: 25/106
FETCH ComfyRegistry Data: 30/106
FETCH ComfyRegistry Data: 35/106
FETCH ComfyRegistry Data: 40/106
FETCH ComfyRegistry Data: 45/106
FETCH ComfyRegistry Data: 50/106
FETCH ComfyRegistry Data: 55/106
FETCH ComfyRegistry Data: 60/106
FETCH ComfyRegistry Data: 65/106
FETCH ComfyRegistry Data: 70/106
FETCH ComfyRegistry Data: 75/106
FETCH ComfyRegistry Data: 80/106
FETCH ComfyRegistry Data: 85/106
FETCH ComfyRegistry Data: 90/106
FETCH ComfyRegistry Data: 95/106
FETCH ComfyRegistry Data: 100/106
FETCH ComfyRegistry Data: 105/106
FETCH ComfyRegistry Data [DONE]
[ComfyUI-Manager] default cache updated: https://api.comfy.org/nodes
FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json [DONE]
[ComfyUI-Manager] All startup tasks have been completed.
```

### Other

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.