Skip to content

nodes_textgen: Implement use_default_template for LTX#13451

Merged
comfyanonymous merged 1 commit into
Comfy-Org:masterfrom
rattus128:prs/ltx-text-template
Apr 17, 2026
Merged

nodes_textgen: Implement use_default_template for LTX#13451
comfyanonymous merged 1 commit into
Comfy-Org:masterfrom
rattus128:prs/ltx-text-template

Conversation

@rattus128
Copy link
Copy Markdown
Contributor

@rattus128 rattus128 commented Apr 17, 2026

#13448 (Fix confirmed by OP)

This subclass inherits the schema directly without accepting the new argument to execute.

Example Test Conditions:

image

Before:

got prompt
CLIP/text encoder model load device: cuda:0, offload device: cpu, current: cpu, dtype: torch.float16
!!! Exception during processing !!! TextGenerateLTX2Prompt.execute() got an unexpected keyword argument 'use_default_template'
Traceback (most recent call last):
  File "/home/rattus/ComfyUI/execution.py", line 534, in execute
    output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rattus/ComfyUI/execution.py", line 334, in get_output_data
    return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rattus/ComfyUI/execution.py", line 308, in _async_map_node_over_list
    await process_inputs(input_dict, i)
  File "/home/rattus/ComfyUI/execution.py", line 296, in process_inputs
    result = f(**inputs)
             ^^^^^^^^^^^
  File "/home/rattus/ComfyUI/comfy_api/internal/__init__.py", line 149, in wrapped_func
    return method(locked_class, **inputs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rattus/ComfyUI/comfy_api/latest/_io.py", line 1789, in EXECUTE_NORMALIZED
    to_return = cls.execute(*args, **kwargs)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: TextGenerateLTX2Prompt.execute() got an unexpected keyword argument 'use_default_template'

Prompt executed in 0.23 seconds

After:

got prompt
Model Gemma3_12BModel_ prepared for dynamic VRAM loading. 23235MB Staged. 0 patches attached. Force pre-loaded 290 weights: 1497 KB.
Generating tokens:  35%|███▍      | 89/256 [00:02<00:04, 38.35it/s]
Prompt executed in 2.56 seconds

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 17, 2026

📝 Walkthrough

Walkthrough

This change adds a new optional use_default_template parameter (defaulting to True) to the execute methods of two text generation node classes in comfy_extras/nodes_textgen.py: TextGenerate and TextGenerateLTX2Prompt. The parameter is passed through to the parent class's execute method and controls template behavior during tokenization via the skip_template flag. The underlying prompt formatting logic remains unchanged. The modification is minimal, affecting only the method signatures and parameter forwarding.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding use_default_template parameter support to the LTX subclass (TextGenerateLTX2Prompt).
Description check ✅ Passed The description directly references the issue and provides before/after logs showing the specific error being fixed and successful execution afterward.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@comfyanonymous comfyanonymous merged commit 05f7531 into Comfy-Org:master Apr 17, 2026
16 of 17 checks passed
pollockjj pushed a commit to pollockjj/ComfyUI that referenced this pull request Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants