MCPcopy Index your code
hub / github.com/huggingface/diffusers / calculate_layers

Function calculate_layers

scripts/convert_aura_flow_to_diffusers.py:15–21  ·  view source on GitHub ↗
(state_dict_keys, key_prefix)

Source from the content-addressed store, hash-verified

13
14
15def calculate_layers(state_dict_keys, key_prefix):
16 dit_layers = set()
17 for k in state_dict_keys:
18 if key_prefix in k:
19 dit_layers.add(int(k.split(".")[2]))
20 print(f"{key_prefix}: {len(dit_layers)}")
21 return len(dit_layers)
22
23
24# similar to SD3 but only for the last norm layer

Callers 2

convert_transformerFunction · 0.70
populate_state_dictFunction · 0.70

Calls 2

addMethod · 0.80
splitMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…