Nodes/ComfyUI_Personalize_Anything/Personalize Anything Sample
ComfyUI Node

Personalize Anything Sample

Paste a subject into a new picture, no LoRA

By smthemex·Created 2 years ago·Updated 5 days ago· 45
Personalize Anything Sample
  • model
  • conditioning
  • source_conditioning
  • inverted_latent
  • source_latent
  • mask
  • latent
◄seed0►
◄steps28►
◄tau50►
◄shift0►
◄eta1.00►
◄mode▾►
◄concept_processfalse►

"Personalize" in ComfyUI normally means LoRA training: a dataset, a captioned folder, twenty minutes of your GPU. This node is not that. Nothing is trained. You give it one photo of a thing, it runs Flux backwards on that photo, and then while the new image is still mostly noise it literally copies the subject's internal tokens into it. That's the whole trick, and it's why it takes seconds instead of an afternoon.

Why anyone cares

The paper behind it (Feng et al., Personalize Anything for Free with Diffusion Transformer, arXiv 2503.12590) landed in March 2025 and got a decent reception on r/StableDiffusion - mostly followed by "cool, wake me up when it's in ComfyUI". It wasn't, for months, and people wanting subject transfer went back to PuLID-style adapters. This pack is the implementation, and PersonalizeAnythingSample is the node that generates the image.

It's the sibling of RF-Inversion, which reached Comfy in late 2024 via the Fluxtapoz pack: that gets you a faithful latent of your reference, and this adds token-copying on top so the subject survives into a new picture instead of being re-edited in place.

The mechanism, briefly

Two images go through the model at once: row 0 is your reference, inverted to noise, and row 1 is fresh noise - the image you're about to make. Both are stepped with a controlled reverse ODE. Row 0 is dragged toward the original latent with a strength of eta; row 1 just takes plain Euler steps. And while the timestep is still above tau, an attention patch copies the q/k/v rows of the masked subject tokens from row 0 into row 1.

The port is exact rather than hand-wavy about it: comfy's Flux blocks hand you q/k/v after the fused projection and QKNorm, and since both are linear-ish per token, replacing the projected rows is equivalent to replacing hidden states the way upstream does it.

One consequence you need to internalise: there is no KSampler in this graph. The node drives the model itself on the official diffusers sigma grid, so steps and seed live on the node and sampler/scheduler widgets never appear.

The inputs that matter

  • mask - semantics flip with mode, and this is where beginners lose an hour. In inpainting / outpainting the mask is the region to replace (it gets inverted internally). In single_personalize / subject_reconstruction the mask is the subject itself in your source image.
  • mode - inpainting and outpainting edit the same image; single_personalize drops the subject somewhere new (needs a target prompt describing the new scene); subject_reconstruction recontextualises while holding identity.
  • steps - set it equal to the Invert node's steps. Same discretisation both directions, per the original algorithm.
  • tau - the 0–100 cutoff for the copy. Lower tau holds the subject more tightly but the result sits less naturally in its new surroundings. 50 is upstream's default; don't touch it until you have a baseline.
  • eta - how hard the source branch is followed. 1.0 = fully.
  • shift - horizontal subject shift in image tokens, one token = 16 px, positive moves the subject left. Only meaningful when you're placing a subject rather than preserving layout.

Then wire the rest: inverted_latent and source_latent come from one Invert node, source_conditioning must match that Invert node's conditioning (upstream uses an empty prompt), and conditioning is the prompt for the image you want. Guidance rides inside that conditioning - add a FluxGuidance node for flux-dev, 3.5. Output is a single latent; it goes into VAEDecode like any other.

Install

ComfyUI Manager → search the pack title, or:

cd ComfyUI/custom_nodes
git clone https://github.com/smthemex/ComfyUI_Personalize_Anything

Restart. Then the models, which are the real cost - a Flux dev stack:

ComfyUI/models/diffusion_models/flux1-dev-fp8-e4m3fn.safetensors   # ~11 GB
ComfyUI/models/clip/clip_l.safetensors
ComfyUI/models/clip/t5xxl_fp8_e4m3fn.safetensors
ComfyUI/models/vae/ae.safetensors

The pack's requirements.txt is now literally just torch. If some tutorial tells you to install diffusers, transformers, peft or accelerate first, you're reading a guide for the old wrapper version.

Where it goes wrong

The nodes don't appear in the menu at all. Old clones of this pack were a diffusers wrapper that died on transformers>=5 and took the whole package down with it. git pull in the folder and restart - the current code needs nothing but Comfy.

Your mask is chunky. The node nearest-resizes the mask down to Flux's 16-pixel token grid and thresholds at 0.5. Feathering and thin details do not survive. Paint fatter than feels right.

Nothing changed in the output. Read the console. The node prints [PersonalizeAnything] <mode> | ... | subject tokens=N | patch fired Mx. If N=0, your mask selected nothing - usually a mask that's the wrong size or inverted for the mode you picked.

It's slow and your VRAM is unhappy. Every step runs a batch of two rows through a 12B transformer - a fatter activation bill than a stock KSampler - and the node unloads everything else first, so CLIP and VAE get evicted and reloaded on demand. On a 12 GB card, drop resolution before you drop steps.

CategoryPersonalizeAnything

Inputs (13)

NameTypeDefaultDescription
modelMODEL—
conditioningCONDITIONINGPrompt of the generated image (target branch, last row).
source_conditioningCONDITIONINGPrompt of the source branch (row 0, the inverted latent). Must match the Invert node's conditioning (upstream: empty).
inverted_latentLATENTFrom PersonalizeAnythingInvert.
source_latentLATENTFrom PersonalizeAnythingInvert.
maskMASK—
seedINT00–18446744073709550000—
stepsINT281–100—
tauFLOAT500–100Timestep (0-100) above which the subject tokens are replaced. Smaller tau = stronger local consistency, less global harmony. 50 = upstream default.
shiftINT0-512–512Horizontal shift of the target region, in image tokens (1 token = 16 px). Positive moves the subject left.
etaFLOAT1.000–1Strength of the source branch (0 = ignore the source, 1 = fully follow it). 1.0 = upstream default.
modeCOMBO4 options: inpainting, outpainting, single_personalize, subject_reconstruction
concept_processoptBOOLEANfalseAlso concatenate the subject tokens to the sequence (upstream `concept_process`). The released upstream app runs with it OFF.

Outputs (1)

NameTypeDescription
latentLATENT—