Replicate fofr/style-transfer
Copy a style image's look onto a new generation
- style_image
- structure_image
- IMAGE
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, oranimated. 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:
then restart.cd ComfyUI/custom_nodes git clone https://github.com/replicate/comfyui-replicate cd comfyui-replicate pip install -r requirements.txt
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.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| style_image | IMAGE | — | |
| structure_imageopt | IMAGE | — | |
| promptopt | STRING | An astronaut riding a unicorn | — |
| negative_promptopt | STRING | — | |
| widthopt | INT | 1024 | — |
| heightopt | INT | 1024 | — |
| modelopt | COMBO | fast | 5 options: fast, high-quality, realistic, cinematic, animated |
| number_of_imagesopt | INT | 11–10 | — |
| structure_depth_strengthopt | FLOAT | 1.000–2 | — |
| structure_denoising_strengthopt | FLOAT | 0.650–1 | — |
| output_formatopt | COMBO | webp | 3 options: webp, jpg, png |
| output_qualityopt | INT | 800–100 | — |
| seedopt | INT | — | |
| force_rerunopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |