bytedance / flux-pulid

⚡️FLUX PuLID: FLUX-dev based Pure and Lightning ID Customization via Contrastive Alignment🎭

  • Public
  • 2M runs
  • GitHub
  • Paper
  • License
Iterate in playground

Input

main_face_image
*file

Upload an ID image for face generation

string
Shift + Return to add a new line

Enter a text prompt to guide image generation

Default: "portrait, color, cinematic"

integer
(minimum: 256, maximum: 1536)

Set the width of the generated image (256-1536 pixels)

Default: 896

integer
(minimum: 256, maximum: 1536)

Set the height of the generated image (256-1536 pixels)

Default: 1152

integer
(minimum: 1, maximum: 20)

Set the number of denoising steps (1-20)

Default: 20

integer
(minimum: 0, maximum: 10)

Set the timestep to start inserting ID (0-4 recommended, 0 for highest fidelity, 4 for more editability)

Default: 0

number
(minimum: 1, maximum: 10)

Set the guidance scale for text prompt influence (1.0-10.0)

Default: 4

number
(minimum: 0, maximum: 3)

Set the weight of the ID image influence (0.0-3.0)

Default: 1

integer
(minimum: 1, maximum: 4)

Set the number of images to generate (1-4)

Default: 1

Including negative_prompt and 5 more...
string
Shift + Return to add a new line

Enter a negative prompt to specify what to avoid in the image

Default: "bad quality, worst quality, text, signature, watermark, extra limbs, low resolution, partially rendered objects, deformed or partially rendered eyes, deformed, deformed eyeballs, cross-eyed, blurry"

integer

Set a random seed for generation (leave blank or -1 for random)

number
(minimum: 1, maximum: 10)

Set the Classifier-Free Guidance (CFG) scale. 1.0 uses standard CFG, while values >1.0 enable True CFG for more precise control over generation. Higher values increase adherence to the prompt at the cost of image quality.

Default: 1

integer
(minimum: 128, maximum: 512)

Set the max sequence length for prompt (T5), smaller is faster (128-512)

Default: 128

string

Choose the format of the output image

Default: "webp"

integer
(minimum: 1, maximum: 100)

Set the quality of the output image for jpg and webp (1-100)

Default: 80

Output

outputoutputoutputoutput
Generated in

Run time and cost

This model costs approximately $0.028 to run on Replicate, or 35 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 A100 (80GB) GPU hardware. Predictions typically complete within 21 seconds.

Readme

PuLID for FLUX

Welcome to PuLID-FLUX-v0.9.0, a tuning-free ID customization solution for FLUX.1-dev.

🆕 Looking for the classic PuLID for Stable Diffusion XL? Check out our Classic PuLID demo!

About PuLID for FLUX

PuLID (Pure and Lightning ID customization) is an AI model that customizes images, especially faces, while keeping important identity features. This version is specifically optimized for FLUX.1-dev. Here’s what PuLID for FLUX does:

  • It adds a specific identity (like a person’s face) to the FLUX.1-dev text-to-image model without changing how the model usually works.
  • It creates images with high identity similarity.
  • It lets you change things like attributes, styles, and backgrounds using text prompts.
  • It keeps image elements like background, lighting, and style consistent.
  • It gives you lots of options to edit and change the generated images.

PuLID for FLUX uses some cool tech stuff: - It has two main parts: a regular diffusion training part and a new Lightning T2I part. - It uses special ways to understand facial identity. - It uses a technique called “contrastive alignment” to keep images consistent. - It can create images quickly while still getting the identity right.

You can use PuLID for FLUX for things like: - Making avatars and characters - Editing and improving faces - Creating digital art - Making prototypes and visualizations

How to Use This Replicate Demo

  1. Upload an image with the identity you want to use.
  2. Write a prompt describing the image you want to create.
  3. Adjust the settings if you need to (check out the “Useful Tips” below).
  4. Click to generate your customized image!

Useful Tips

Two important settings to think about:

  1. Timestep to start inserting ID:
  2. This decides when to start adding the identity during image creation.
  3. Lower numbers (0-1) make the identity look more similar but might be harder to edit.
  4. Higher numbers (like 4) are easier to edit but might make the identity less similar.
  5. We suggest using 4 for realistic images, and 0-1 for stylized images.

  6. True CFG scale:

  7. FLUX.1-dev uses something called a “fake CFG” usually.
  8. You can choose to use either fake CFG or true CFG.
  9. Fake CFG often works well for realistic-looking scenes.
  10. True CFG might make the identity look more similar in some cases.
  11. Try true CFG for stylized scenes if the identity doesn’t look similar enough or the style isn’t quite right.

Limitations

This is a test version. We’ve noticed that it might not work as well for some male faces. We’re working on making it better, so check back for updates!

Examples

Here are some examples generated with PuLID-FLUX:

PuLID-FLUX Examples

Learn More

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

If PuLID-FLUX is helpful, please star our repo or tell your friends about it!

Questions or Suggestions?

If you have questions or ideas, 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