USO Sampler
Content Image, Two Style Images, and a Prayer for VRAM
- uso_model
- content_image
- style_image_1
- style_image_2
- IMAGE
- LATENT
The USO Sampler is the second half of the USO_ComfyUI story, and it's where the model's whole trick lives: it generates from a prompt plus a content reference and up to two style references, no LoRA training required. The catch is upfront - the pack's README says the author never got it running on consumer hardware and hit torch.OutOfMemoryError at every step. So this is a sampler that wants to be great, and currently is a proof of concept. Know that before you queue up a batch.
Why you'd reach for it. Style transfer is the pain point this targets. With plain Flux you either write prompts that describe the style in prose (fragile), or you train a LoRA (heavy, and hopeless if you only have one or two reference images). USO's pitch is: paste in a content image for the subject, paste in a style image, and let the model carry it. The community's comparisons of open-source style-transfer methods put USO near the top of that no-training category, which is exactly why the native ComfyUI support (Sept 2025) got picked up so fast.
How it works. The sampler is a full rectified-flow loop. The prompt goes through the T5 and CLIP encoders the loader bundled, your content image gets VAE-encoded into a reference latent (preprocessed down to content_ref_size), and your style images go through SigLIP. Then it runs the standard Euler-style flow iteration - img += (t_prev - t_curr) * pred, with a guidance vector folded in - for steps iterations. The one bit of author ingenuity: the VAE gets pushed to CPU for the diffusion loop and dragged back for the final decode, an explicit attempt to buy VRAM headroom. It wasn't enough to save him, but it tells you he was thinking about the exact problem.
Inputs that matter. You get a lot of knobs. Most of them are ordinary - prompt, seed, steps (25), width/height (1024, snapped to multiples of 64), guidance (4.0, range 0–10). The ones worth caring about:
content_image+content_ref_size- the content/subject reference, and how many pixels its long edge gets resized to before encoding (default 512, up to 1024). Smaller is cheaper and looser.style_image_1/style_image_2- up to two style references, both optional. One is usually the better start.uso_model- the bundle from the USO Model Loader. Non-negotiable.
Outputs. Two: IMAGE (the finished render, decoded and normalized to 0–1) and LATENT (the raw samples, if you want to feed something else downstream instead of using the decoded image).
Installing. Same pack as the loader - clone, restart, done:
cd ComfyUI/custom_nodes
git clone https://github.com/Juste-Leo2/USO_ComfyUI.git
No requirements.txt; the dependencies ride on ComfyUI's own Python env plus the vendored uso/ package.
Common issues. The big one isn't subtle: it OOMs. The author says loading or sampling systematically dies on consumer GPUs, and since he couldn't validate any of it, you're the test bench. Start at minimum resolution with no references just to see if the loop runs at all. If style transfer is the goal and you have 24 GB, try ComfyUI's native USO workflow (ModelPatch Loader + the ByteDance projector) - that's the version people actually reported running, at "as fast as Flux T2I" on a 3090 in fp8. This sampler is the one you install when you want to watch the mechanism, not the one you install to ship images.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| uso_model | USO_MODEL | — | |
| prompt | STRING | A beautiful woman. | — |
| seed | INT | 00–18446744073709550000 | — |
| steps | INT | 251–100 | — |
| width | INT | 102464–2048 | — |
| height | INT | 102464–2048 | — |
| guidance | FLOAT | 4.00–10 | — |
| content_ref_size | INT | 512256–1024 | — |
| content_imageopt | IMAGE | — | |
| style_image_1opt | IMAGE | — | |
| style_image_2opt | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| LATENT | LATENT | — |