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

Function get_sigmas

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

Source from the content-addressed store, hash-verified

1237 )
1238
1239 def get_sigmas(timesteps, n_dim=4, dtype=torch.float32):
1240 sigmas = noise_scheduler_copy.sigmas.to(device=accelerator.device, dtype=dtype)
1241 schedule_timesteps = noise_scheduler_copy.timesteps.to(accelerator.device)
1242 timesteps = timesteps.to(accelerator.device)
1243 step_indices = [(schedule_timesteps == t).nonzero().item() for t in timesteps]
1244
1245 sigma = sigmas[step_indices].flatten()
1246 while len(sigma.shape) < n_dim:
1247 sigma = sigma.unsqueeze(-1)
1248 return sigma
1249
1250 image_logs = None
1251 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