feat: PuLID-Flux identity-injection support#1595
Open
RapidMark wants to merge 1 commit into
Open
Conversation
Adds PuLID-Flux identity injection to the Flux denoise path: a pulid.hpp module, the id-embedding threaded through flux.hpp and stable-diffusion.cpp, CLI flags in examples/common, and scripts/pulid_extract_id.py to produce the embedding. The id-embedding is stored as a gguf container (a single fp16 tensor) and loaded through the same gguf_init_from_file path as the pulid_ca weights, so there's no bespoke binary header.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds PuLID-Flux identity injection to the Flux denoise path (works on CUDA / Vulkan / HIP).
This supersedes #1542 — I rebased onto current master and reworked the id-embedding into a gguf container like @Green-Sky suggested over there, so it loads through the same
gguf_init_from_filepath as thepulid_caweights and the custom header is gone. Opening fresh rather than force-pushing #1542 because that branch had drifted onto an old master and the history got tangled; a clean rebase seemed easier to review.What's in it:
src/pulid.hpp— the id-embedding moduleflux.hpp+stable-diffusion.cpp--pulid/ id-image flags inexamples/commonscripts/pulid_extract_id.py— produces the embedding (writes the gguf)docs/pulid.md— usageThe embedding is a single fp16 tensor in a gguf file. Tested end to end on NVIDIA (CUDA + Vulkan), AMD RDNA2 (Vulkan) and RDNA4 (ROCm + Vulkan) — same seed, identity holds across backends.