Sleeping
💻
None defined yet.
#Prepare a list t of num_of_results values between 0 and 1
t_space = torch.linspace(0, 1, num_of_results)
for t in tqdm(t_space):
mix_factor = t.item()
# interpolate between the two face images
image = (image1 * (1 - mix_factor) + image2 * mix_factor).astype(np.uint8)
# interpolate between the two face embedding
faceid_embeds = torch.lerp(faceid_embeds1, faceid_embeds2, t)
#generate interpolated result
images = ip_model.generate(prompt=prompt, negative_prompt=negative_prompt, face_image=image, faceid_embeds=faceid_embeds, shortcut=v2, num_samples=2, scale=scale, s_scale=s_scale, guidance_scale=guidance_scale, width=width, height=height, num_inference_steps=steps, seed=seed)