bytedance / pulid

πŸ“– PuLID: Pure and Lightning ID Customization via Contrastive Alignment

  • Public
  • 1.8M runs
  • L40S
  • GitHub
  • Paper
  • License

Input

*file
Preview
main_face_image

ID image (main)

file

Additional ID image (auxiliary)

file

Additional ID image (auxiliary)

file

Additional ID image (auxiliary)

string
Shift + Return to add a new line

Prompt

Default: "portrait,color,cinematic,in garden,soft light,detailed face"

string
Shift + Return to add a new line

Negative Prompt

Default: "flaws in the eyes, flaws in the face, flaws, lowres, non-HDRi, low quality, worst quality,artifacts noise, text, watermark, glitch, deformed, mutated, ugly, disfigured, hands, low resolution, partially rendered objects, deformed or partially rendered eyes, deformed, deformed eyeballs, cross-eyed,blurry"

number
(minimum: 1, maximum: 1.5)

CFG, recommend value range [1, 1.5], 1 will be faster

Default: 1.2

integer
(minimum: 1, maximum: 100)

Steps

Default: 4

integer
(minimum: 512, maximum: 2024)

Height

Default: 1024

integer
(minimum: 512, maximum: 2024)

Width

Default: 768

number
(minimum: 0, maximum: 5)

ID scale

Default: 0.8

string

mode

Default: "fidelity"

boolean

ID Mix (if you want to mix two ID image, please turn this on, otherwise, turn this off)

Default: false

integer

Random seed. Leave blank to randomize the seed

integer
(minimum: 1, maximum: 8)

Num samples

Default: 4

string

Format of the output images

Default: "webp"

integer
(minimum: 0, maximum: 100)

Quality of the output images, from 0 to 100. 100 is best quality, 0 is lowest quality.

Default: 80

Output

outputoutputoutputoutput
Generated in

This example was created by a different version, bytedance/pulid:c169c3b8.

Run time and cost

This model costs approximately $0.0026 to run on Replicate, or 384 runs per $1, but this varies depending on your inputs. It is also open source and you can run it on your own computer with Docker.

This model runs on Nvidia L40S GPU hardware. Predictions typically complete within 3 seconds.

Readme

PuLID: Pure and Lightning ID Customization (Classic Version)

Welcome to PuLID v1.0, a tuning-free ID customization solution for text-to-image models. This is the classic version of PuLID, designed to work with Stable Diffusion XL.

πŸ†• Looking for PuLID for FLUX? Check out our FLUX-PuLID demo!

About PuLID

PuLID (Pure and Lightning ID customization) is an AI model that customizes images, especially faces, while preserving important identity features. Here’s what PuLID does:

  • Adds a specific identity (like a person’s face) to a text-to-image model without altering the model’s core functionality.
  • Creates images with high identity similarity.
  • Allows modification of attributes, styles, and backgrounds using text prompts.
  • Maintains consistency in image elements like background, lighting, and style.
  • Provides extensive options for editing and refining generated images.

PuLID leverages advanced technologies: - Comprises two main components: a standard diffusion training part and an innovative Lightning T2I part. - Employs sophisticated methods for facial identity comprehension. - Utilizes a β€œcontrastive alignment” technique to ensure image consistency. - Generates images rapidly while maintaining identity accuracy.

Applications of PuLID include: - Creating personalized avatars and characters - Facial editing and enhancement - Developing digital art - Producing prototypes and visualizations

How to Use This Replicate Demo

  1. Upload an image containing the identity you wish to customize.
  2. Enter a text prompt describing the image you want to generate.
  3. Adjust the settings as needed (refer to β€œAdvanced Settings” below).
  4. Click to generate your customized image!

Advanced Settings

  1. Seed: Set a specific seed for reproducible results.
  2. Guidance Scale: Controls how closely the image adheres to your text prompt.
  3. Number of Inference Steps: More steps can lead to higher quality but increase generation time.
  4. Negative Prompt: Describe elements you want to avoid in the generated image.

Useful Tips

  • For best results, use clear, front-facing images of faces as your identity input.
  • Experiment with different prompts to explore various styles and scenarios.
  • If the generated image doesn’t capture the identity well, try adjusting the guidance scale or increasing the number of inference steps.
  • Use negative prompts to refine your results, especially for avoiding unwanted elements.

Limitations

  • While PuLID performs well on a wide range of identities, results may vary depending on the input image quality and facial characteristics.
  • Very complex or abstract prompts might lead to less accurate identity preservation.
  • The model works best with front-facing, clear images of faces.

Examples

Here are some examples of images generated with PuLID:

PuLID Examples

Learn More

For more technical details, latest updates, and additional examples, visit our GitHub repository.

If you find PuLID helpful, please star our repo or share it with others!

Questions or Suggestions?

If you have questions or ideas for improvement, please open an issue on our GitHub repository.

Citation

If you use PuLID in your work, please cite:

@article{guo2024pulid,
  title={PuLID: Pure and Lightning ID Customization via Contrastive Alignment},
  author={Guo, Zinan and Wu, Yanze and Chen, Zhuowei and Chen, Lang and He, Qian},
  journal={arXiv preprint arXiv:2404.16022},
  year={2024}
}

Support

For updates and more AI content, follow: - The lead developers: - Yanze Wu: GitHub - Zinan Guo: Email