Nodes/ComfyUI-Replicate/Replicate fofr/style-transfer
ComfyUI Node

Replicate fofr/style-transfer

Copy a style image's look onto a new generation

By replicate·Created 2 years ago·Updated 2 years ago· 207
Replicate fofr/style-transfer
  • style_image
  • structure_image
  • IMAGE
promptAn astronaut riding a unicorn
negative_prompt
width1024
height1024
modelfast
number_of_images1
structure_depth_strength1.00
structure_denoising_strength0.65
output_formatwebp
output_quality80
seed
force_rerunfalse

Hand it an image whose look you like - a painting, a photo with a particular grade, an illustration style - and it generates new images in that style from your prompt. Optionally give it a second image for structure, and it'll keep that image's composition while wearing the first one's style. It's fofr's style-transfer model, and it's a clean way to say "make me something new that looks like this."

This is a Replicate node, so it runs in the cloud: your images and prompt go up to Replicate, the model runs on their GPU, the result comes back. You need a Replicate account and a REPLICATE_API_TOKEN, and you pay per run. Nothing installs locally beyond the wrapper.

How it works

The style comes from an IP-Adapter-style mechanism: the model reads the aesthetic of your style_image and biases the whole generation toward it, rather than copying pixels. If you add a structure_image, a depth ControlNet locks in that image's layout so the new render matches its composition. So there are two separate levers - one for "what should it look like," one for "how should it be arranged" - and you can use either or both.

The inputs and outputs that matter

  • style_image (required) - the look to copy. This is the anchor.
  • prompt - what to generate in that style. With no structure image, this is pure text-to-image wearing the style.
  • structure_image - optional; supply it to keep a specific composition.
  • structure_denoising_strength (0.65) - how much of the structure image's layout to keep. Lower holds the composition tightly, higher lets it drift toward the prompt.
  • model (fast) - the base checkpoint: fast, high-quality, realistic, cinematic, or animated. Pick to match the output you want.

Output is a single IMAGE (or several - number_of_images goes up to 10). Other knobs: negative_prompt, width/height, structure_depth_strength (1) for how strongly the depth control bites, output_format/output_quality, seed, and force_rerun to skip Replicate's cache.

How to install it

One install covers every Replicate node.

  • ComfyUI Manager: search ComfyUI-Replicate, install, restart.
  • Manual:
    cd ComfyUI/custom_nodes
    git clone https://github.com/replicate/comfyui-replicate
    cd comfyui-replicate
    pip install -r requirements.txt
    
    then restart.

No weights download - just the replicate pip package. Set your token before launching ComfyUI: export REPLICATE_API_TOKEN="r8_..." (replicate.com/account/api-tokens).

Common issues & troubleshooting

The style didn't come through strongly enough. Use a style_image that's stylistically consistent and unambiguous - a busy photo with mixed looks gives the model a muddy target. Match the model to the vibe (animated for illustration, cinematic for graded film looks) so you're not fighting the base checkpoint.

With a structure image, the output either ignores my layout or copies it too rigidly. That's structure_denoising_strength and structure_depth_strength. Lower denoising and higher depth strength = stick closer to the structure image; the reverse lets the prompt take over. Nudge them in opposite directions until the balance is right.

It's slower or pricier than I expected. Bumping number_of_images and switching model to high-quality both cost more per call. Prototype on fast with one image, then scale up the winner.

Same result on a re-run. Replicate cached it for identical inputs - change the seed or set force_rerun.

CategoryReplicate

Inputs (14)

NameTypeDefaultDescription
style_imageIMAGE
structure_imageoptIMAGE
promptoptSTRINGAn astronaut riding a unicorn
negative_promptoptSTRING
widthoptINT1024
heightoptINT1024
modeloptCOMBOfast5 options: fast, high-quality, realistic, cinematic, animated
number_of_imagesoptINT11–10
structure_depth_strengthoptFLOAT1.000–2
structure_denoising_strengthoptFLOAT0.650–1
output_formatoptCOMBOwebp3 options: webp, jpg, png
output_qualityoptINT800–100
seedoptINT
force_rerunoptBOOLEANfalse

Outputs (1)

NameTypeDescription
IMAGEIMAGE