Doron Adler PRO

Norod78

AI & ML interests

Fooling around with Generative machine learning models.

Organizations

Posts 1

view post
Post
I've prepared a Google Colab notebook which allows you to play with interpolating between different people using IP-Adapter SDXL Face-ID Plus.

#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)


Link to notebook:
Norod78/face_id_v2_test_code

Link to Face-ID Repo:
h94/IP-Adapter-FaceID

Link to all sorts of generated examples (Use the file tab):
Norod78/face_id_v2_test_code