mirror of
https://github.com/jags111/efficiency-nodes-comfyui.git
synced 2026-03-24 22:52:13 -03:00
Merge pull request #81 from alexopus/lora_stack_to_string
Add LoRA Stack to String converter
This commit is contained in:
@@ -4142,6 +4142,26 @@ class TSC_Tiled_Upscaler:
|
|||||||
script["tile"] = (upscale_by, tile_size, tiling_strategy, tiling_steps, seed, denoise, tile_controlnet, strength)
|
script["tile"] = (upscale_by, tile_size, tiling_strategy, tiling_steps, seed, denoise, tile_controlnet, strength)
|
||||||
return (script,)
|
return (script,)
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
# TSC LoRA Stack to String converter
|
||||||
|
class TSC_LoRA_Stack2String:
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(cls):
|
||||||
|
return {"required": {"lora_stack": ("LORA_STACK",)}}
|
||||||
|
|
||||||
|
RETURN_TYPES = ("STRING",)
|
||||||
|
RETURN_NAMES = ("LoRA string",)
|
||||||
|
FUNCTION = "convert"
|
||||||
|
CATEGORY = "Efficiency Nodes/Misc"
|
||||||
|
|
||||||
|
def convert(self, lora_stack):
|
||||||
|
"""
|
||||||
|
Converts a list of tuples into a single space-separated string.
|
||||||
|
Each tuple contains (STR, FLOAT1, FLOAT2) and is converted to the format "<lora:STR:FLOAT1:FLOAT2>".
|
||||||
|
"""
|
||||||
|
output = ' '.join(f"<lora:{tup[0]}:{tup[1]}:{tup[2]}>" for tup in lora_stack)
|
||||||
|
return (output,)
|
||||||
|
|
||||||
########################################################################################################################
|
########################################################################################################################
|
||||||
# NODE MAPPING
|
# NODE MAPPING
|
||||||
NODE_CLASS_MAPPINGS = {
|
NODE_CLASS_MAPPINGS = {
|
||||||
@@ -4179,7 +4199,8 @@ NODE_CLASS_MAPPINGS = {
|
|||||||
"Image Overlay": TSC_ImageOverlay,
|
"Image Overlay": TSC_ImageOverlay,
|
||||||
"Noise Control Script": TSC_Noise_Control_Script,
|
"Noise Control Script": TSC_Noise_Control_Script,
|
||||||
"HighRes-Fix Script": TSC_HighRes_Fix,
|
"HighRes-Fix Script": TSC_HighRes_Fix,
|
||||||
"Tiled Upscaler Script": TSC_Tiled_Upscaler
|
"Tiled Upscaler Script": TSC_Tiled_Upscaler,
|
||||||
|
"LoRA Stack to String converter": TSC_LoRA_Stack2String
|
||||||
}
|
}
|
||||||
|
|
||||||
########################################################################################################################
|
########################################################################################################################
|
||||||
|
|||||||
Reference in New Issue
Block a user