MCPcopy Create free account
hub / github.com/TencentARC/BrushNet / convert_attn_naming

Function convert_attn_naming

scripts/convert_dance_diffusion_to_diffusers.py:152–158  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

150
151
152def convert_attn_naming(name):
153 for key, value in ATTN_MAP.items():
154 if name.startswith(key) and not isinstance(value, list):
155 return name.replace(key, value)
156 elif name.startswith(key):
157 return [name.replace(key, v) for v in value]
158 raise ValueError(f"Attn error with {name}")
159
160
161def rename(input_string, max_depth=13):

Callers 1

renameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected