MCPcopy Create free account
hub / github.com/tdrussell/diffusion-pipe / bucket_suffix

Function bucket_suffix

utils/dataset.py:59–70  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

57
58
59def bucket_suffix(key):
60 if len(key) == 2:
61 # AR, frames
62 return f'{key[0]:.{ROUND_DECIMAL_DIGITS}f}_{key[1]}'
63 elif len(key) == 3:
64 # width, height, frames
65 return f'{key[0]}x{key[1]}x{key[2]}'
66 elif len(key) == 4:
67 # AR, width, height, frames
68 return f'{key[0]:.{ROUND_DECIMAL_DIGITS}f}x{key[1]}x{key[2]}x{key[3]}'
69 else:
70 raise RuntimeError(f'Unexpected bucket: {key}')
71
72
73def dedup_and_sort(values):

Callers 6

__init__Method · 0.85
__init__Method · 0.85
cache_latentsMethod · 0.85
cache_metadataMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected