Nodes/ComfyUI_PhotoDoodle/PhotoDoodle_Loader
ComfyUI Node

PhotoDoodle_Loader

One node that assembles your whole FLUX.1-dev stack

By smthemex·Created about a year ago·Updated about a year ago· 93
PhotoDoodle_Loader
    • model
    flux_unet
    vae
    pre_lora
    loras
    flux_repo
    use_mmgpfalse
    profile_number

    If you've ever loaded FLUX.1-dev the conventional ComfyUI way - a diffusion-model loader, a VAE loader, a DualCLIPLoader for the T5, then one or two LoRA loaders - you know it's a chain of parts that each wants a different folder. PhotoDoodle_Loader collapses the whole chain into one node. You pick a model, pick a LoRA, and out the other end comes a single MODEL_PhotoDoodle object that only one other node on earth knows what to do with: PhotoDoodle_Sampler.

    This is the "assemble everything" half of a deliberately small two-node pack. The pack is a ComfyUI port of PhotoDoodle, the Show Lab's Learning Artistic Image Editing from Few-Shot Pairwise Data (arXiv 2502.14397). The idea is straightforward: train on pairs of before/after photos so a FLUX.1-dev model learns a doodle effect - a halo and wings, a flame edge, a paint-splash filter - and can apply it to a real image while leaving the rest of the photo alone. The Loader is the unglamorous half: it loads FLUX, fuses the LoRAs, and wires up the pipeline. The Sampler is where your photo actually gets doodled on.

    How it works

    Under the hood the Loader assembles a diffusers FluxPipeline from whatever you hand it. The README lays out three input paths, in order of preference:

    • Repo mode - put a Hugging Face id or a local diffusers folder in flux_repo (e.g. black-forest-labs/FLUX.1-dev). The author's first recommendation, and the one that auto-downloads.
    • Single-file fp8 checkpoint - e.g. flux1-dev-fp8.safetensors (~16G) in models/diffusion_models. Per the README, "normal 12G can run" without extra offload tricks.
    • Separate unet + vae + ComfyUI T5 - the least recommended: more likely to OOM, and it drags a CLIP dependency into the Sampler.

    Then it loads pretrain.safetensors, fuses it, unloads, loads the effect LoRA, and turns on model CPU offload. That "pretrain + effect" dance is the whole trick: the pretrain LoRA is what turns vanilla FLUX into a PhotoDoodle model, and the effect LoRA is the specific style you asked for.

    The inputs that matter

    • flux_repo - empty string uses the single-file/unet path; an HF id or local path switches to repo mode. If you have 12–24GB, this is where you start.
    • flux_unet / vae - dropdowns of your diffusion_models and vae folders. With a single-file FLUX checkpoint that bundles CLIP and VAE, set vae to "none". Pick a separate vae only for the unet+ae+clip path.
    • pre_lora - the mandatory pretrain.safetensors. Quirk: the dropdown only lists LoRAs with "pre" in the filename, so keep that name.
    • loras - the effect LoRA (sksmagiceffects, sksedgeeffect, …). Both LoRAs are effectively required; the code throws ValueError("No model selected") if either is "none".
    • use_mmgp and profile_number - flip use_mmgp on and the loader hands the pipeline to mmgp's VRAM offload profiler, with a handful of preset profiles. It's the author's own OOM escape hatch.

    The single output, model (MODEL_PhotoDoodle), wires straight into PhotoDoodle_Sampler's model input.

    Installing it

    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 ComfyUI. requirements.txt pins diffusers==0.32.2 and pulls accelerate, transformers, peft, and bitsandbytes (that last one covers the fp8/nf4 quantized loading). Then download pretrain.safetensors plus the effect LoRAs from huggingface.co/nicolaus-huang/PhotoDoodle into models/loras, and your FLUX.1-dev checkpoint into models/diffusion_models.

    Where people get burned

    • OOM. Single-file fp8 handles roughly 12G; below that, repo mode plus use_mmgp is the lever. The README literally says "if OOM, try mmgp".
    • Picking a VAE with a single-file model. Any non-"none" vae is read as "you're doing the unet path", which flips an internal flag and makes the Sampler demand a CLIP you weren't planning to provide.
    • The pinned diffusers==0.32.2. If another custom node insists on a different diffusers version, one of them breaks. Welcome to dependency roulette.
    • License. This builds on FLUX.1-dev, whose non-commercial license covers selling what you generate but not hosting the weights - fine for personal use, not for a paid service.
    CategoryPhotoDoodle

    Inputs (7)

    NameTypeDefaultDescription
    flux_unetCOMBO1 options: none
    vaeCOMBO1 options: none
    pre_loraCOMBO1 options: none
    lorasCOMBO1 options: none
    flux_repoSTRING
    use_mmgpBOOLEANfalse
    profile_numberCOMBO6 options: 0, 1, 2, 3, 4, 5

    Outputs (1)

    NameTypeDescription
    modelMODEL_PhotoDoodle