MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / get_sigmas

Function get_sigmas

diffusers/examples/controlnet/train_controlnet_flux.py:1218–1227  ·  view source on GitHub ↗
(timesteps, n_dim=4, dtype=torch.float32)

Source from the content-addressed store, hash-verified

1216 )
1217
1218 def get_sigmas(timesteps, n_dim=4, dtype=torch.float32):
1219 sigmas = noise_scheduler_copy.sigmas.to(device=accelerator.device, dtype=dtype)
1220 schedule_timesteps = noise_scheduler_copy.timesteps.to(accelerator.device)
1221 timesteps = timesteps.to(accelerator.device)
1222 step_indices = [(schedule_timesteps == t).nonzero().item() for t in timesteps]
1223
1224 sigma = sigmas[step_indices].flatten()
1225 while len(sigma.shape) < n_dim:
1226 sigma = sigma.unsqueeze(-1)
1227 return sigma
1228
1229 image_logs = None
1230 for epoch in range(first_epoch, args.num_train_epochs):

Callers 1

mainFunction · 0.70

Calls 1

toMethod · 0.45

Tested by

no test coverage detected