Skip to content

Embeddings cause the node to break #3

@cheald

Description

@cheald

When an embedding is added to the conditioning text, it may be expanded to multiple tokens, which causes an error:

I added a simple print(token_id) to vector_sculptor_tokens, which produces something like:

token id 49406
token id 4431
...
token id tensor([-0.0215,  0.0080,  0.0078,  ..., -0.0245, -0.0093,  0.0171])
!!! Exception during processing !!!
Traceback (most recent call last):
  File "/srv/ComfyUI/execution.py", line 151, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "/srv/ComfyUI/execution.py", line 81, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
  File "/srv/ComfyUI/execution.py", line 74, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "/srv/ComfyUI/custom_nodes/Vector_Sculptor_ComfyUI/nodes.py", line 165, in exec
    sculptor_tokens = vector_sculptor_tokens(clip, text, sculptor_method, token_normalization, sculptor_intensity)
  File "/srv/ComfyUI/custom_nodes/Vector_Sculptor_ComfyUI/nodes.py", line 106, in vector_sculptor_tokens
    if token_id not in ignored_token_ids and sculptor_multiplier > 0:
RuntimeError: Boolean value of Tensor with more than one value is ambiguous

Here's a workflow which replicates the issue:

broken-with-embedding.json

The embedding is from https://civitai.com/models/148131/ultimate-text-embeddings-sdxl-pack-styles-negative but you can use any multi-vector embedding to replicate the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions