mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-08-08 06:50:15 -03:00
feat: add meta hints user marks for metadata heuristic override
Users can now right-click nodes and assign meta hints (primary_model, primary_sampler, positive_prompt, negative_prompt) to override the metadata processor's heuristic inference. - Store extra_data from the API request so workflow node properties (including lm_marker_role) are accessible during metadata processing. - _get_user_marks scans extra_data.extra_pnginfo.workflow for meta_* marks, falling back to prompt.original_prompt. - extract_generation_params checks user marks before heuristic inference for sampler, model, and prompts. - Warn on duplicate marks or invalid marked nodes.
This commit is contained in:
@@ -135,10 +135,13 @@ class MetadataHook:
|
||||
# Store the dynprompt reference for node lookups
|
||||
if hasattr(prompt, 'original_prompt'):
|
||||
registry.set_current_prompt(prompt)
|
||||
|
||||
|
||||
# Store extra_data for accessing full workflow node properties
|
||||
registry.set_extra_data(extra_data)
|
||||
|
||||
# Execute the original function
|
||||
return original_execute(*args, **kwargs)
|
||||
|
||||
|
||||
# Replace the functions
|
||||
execution._map_node_over_list = map_node_over_list_with_metadata
|
||||
execution.execute = execute_with_prompt_tracking
|
||||
@@ -202,6 +205,9 @@ class MetadataHook:
|
||||
if hasattr(prompt, 'original_prompt'):
|
||||
registry.set_current_prompt(prompt)
|
||||
|
||||
# Store extra_data for accessing full workflow node properties
|
||||
registry.set_extra_data(extra_data)
|
||||
|
||||
# Execute the original function
|
||||
return await original_execute(*args, **kwargs)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user