MCPcopy Index your code
hub / github.com/XPixelGroup/DiffBIR / reshape_weight_for_sd

Function reshape_weight_for_sd

scripts/convert_diffusers_to_sd.py:173–178  ·  view source on GitHub ↗
(w)

Source from the content-addressed store, hash-verified

171
172
173def reshape_weight_for_sd(w):
174 # convert HF linear weights to SD conv2d weights
175 if not w.ndim == 1:
176 return w.reshape(*w.shape, 1, 1)
177 else:
178 return w
179
180
181def convert_vae_state_dict(vae_state_dict):

Callers 1

convert_vae_state_dictFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected