PhotoDoodle_Sampler
The node that actually runs PhotoDoodle
- model
- images
- clip
- image
PhotoDoodle_Sampler is where the pack actually does the thing the GitHub page shows: you feed it a photo, type "add a halo and wings for the cat by sksmagiceffects", and out comes the same cat now wearing wings and a glow - pose, background, and lighting otherwise intact. It's the payoff half of the two-node ComfyUI_PhotoDoodle pack, a port of the Show Lab's PhotoDoodle method (Learning Artistic Image Editing from Few-Shot Pairwise Data, arXiv 2502.14397). FLUX.1-dev is the engine; this node is the steering wheel.
The model comes from its sibling, PhotoDoodle_Loader, which builds the whole FLUX stack and fuses the LoRAs. The Sampler never touches checkpoints itself - you wire the Loader's model output into its model input and get on with it.
How it works
This is a FLUX.1-dev diffusion run with a twist. Instead of starting from pure noise, the node VAE-encodes your input photo into latents, creates a fresh noise latent at the target resolution, and concatenates the two along the sequence dimension. A mask keeps the photo's latents frozen while the noise half gets denoised, and a custom position encoding covers both halves so the transformer knows which tokens are your picture. Your photo rides along as a fixed conditioning stream rather than being "described in the prompt" - the same latent-concat family of trick as FLUX Kontext-style editing. What makes PhotoDoodle different is that the model was fine-tuned on before/after pairs, so the fused LoRA already knows what "doodle" means: you say what to add, it adds exactly that, anchored to the real photo.
One practical detail: your input image is resized to the width/height you set, so those two fields are the output resolution as well as the canvas the photo gets scaled onto.
The inputs that matter
model- theMODEL_PhotoDoodlefrom the Loader. Non-negotiable.images- the photo(s) to edit, straight from a LoadImage. A whole batch works; the node processes each image in turn with a progress bar.prompt- the instruction plus the trigger, e.g.add a halo and wings for the cat by sksmagiceffects. Thatby sks<something>suffix is the LoRA trigger word, and it has to match the effect LoRA the Loader fused (sksmagiceffects,sksmonstercalledlulu,skspaintingeffects,sksedgeeffect).width/height- 256–4096, in steps of 64; defaults 512×768. Your input photo gets resized to these.steps- 20 by default, and that's genuinely enough here.guidance_scale- 3.5, classic FLUX territory.max_sequence_length- 512, the standard T5 window for FLUX.clip(optional) - only needed when the Loader was set up in unet + vae + ComfyUI T5 mode. Then wire in a DualCLIPLoader (t5xxl + clip_l) so the Sampler can build prompt embeddings itself. In the recommended single-file or repo setups, leave it unplugged.
The output, image (IMAGE), feeds a standard SaveImage (or PreviewImage).
Installing it
Same as the Loader - one pack, one install. ComfyUI Manager search ComfyUI_PhotoDoodle, or:
cd ComfyUI/custom_nodes
git clone https://github.com/smthemex/ComfyUI_PhotoDoodle
pip install -r requirements.txt
then restart. Models are the shared burden: a FLUX.1-dev checkpoint (single-file fp8 is the sweet spot for ~12G cards) plus pretrain.safetensors and the effect LoRAs from huggingface.co/nicolaus-huang/PhotoDoodle, dropped into models/loras.
Where people get burned
- "No clip selected" - the Loader is in unet+vae mode, so it flagged that a CLIP is required. Wire one in, or switch the Loader to single-file/repo mode and leave it.
- The effect doesn't appear. Nine times out of ten the
by sks…trigger in your prompt doesn't match the LoRA you picked in the Loader. They have to agree. - OOM at high resolutions. This is a 12B model with an extra conditioning stream; crank
width/heightup and VRAM goes with it. Enableuse_mmgpon the Loader or dial resolution back. - License. It inherits FLUX.1-dev's non-commercial license: fine to sell your outputs, not fine to host the weights for others.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL_PhotoDoodle | — | |
| images | IMAGE | — | |
| prompt | STRING | add a halo and wings for the cat by sksmagiceffects | — |
| width | INT | 512256–4096 | — |
| height | INT | 768256–4096 | — |
| steps | INT | 201–1024 | — |
| guidance_scale | FLOAT | 3.50–10 | — |
| max_sequence_length | INT | 512128–512 | — |
| clipopt | CLIP | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |