This commit is contained in:
lvmin
2023-10-14 04:39:56 -07:00
parent 42c7365103
commit 79b1a605a7
+10 -14
View File
@@ -452,20 +452,16 @@ def process_diffusion(positive_cond, negative_cond, steps, switch, width, height
target_model = final_unet target_model = final_unet
print('Use base model to refine itself - this may because of developer mode.') print('Use base model to refine itself - this may because of developer mode.')
sigmas = None sigmas = calculate_sigmas(sampler=sampler_name,
len_sigmas = steps - switch scheduler=scheduler_name,
model=target_model.model,
if final_refiner_unet is not None: steps=steps,
sigmas = calculate_sigmas(sampler=sampler_name, denoise=denoise)[switch:]
scheduler=scheduler_name, k1 = target_model.model.latent_format.scale_factor
model=final_refiner_unet.model, k2 = final_unet.model.latent_format.scale_factor
steps=steps, k = float(k1) / float(k2)
denoise=denoise)[switch:] sigmas = sigmas * k
k1 = final_refiner_unet.model.latent_format.scale_factor len_sigmas = len(sigmas) - 1
k2 = final_unet.model.latent_format.scale_factor
k = float(k1) / float(k2)
sigmas = sigmas * k
len_sigmas = len(sigmas) - 1
last_step, last_clean_latent, last_noisy_latent = sample_hijack.history_record[-1] last_step, last_clean_latent, last_noisy_latent = sample_hijack.history_record[-1]
last_clean_latent = final_unet.model.process_latent_out(last_clean_latent.cpu().to(torch.float32)) last_clean_latent = final_unet.model.process_latent_out(last_clean_latent.cpu().to(torch.float32))