Nodes/ComfyUI_CustomNet/CustomNet_Sampler
ComfyUI Node

CustomNet_Sampler

Drop a product shot in, move it around, rotate it — no training required

By smthemex·Created 2 years ago·Updated 2 years ago· 10
CustomNet_Sampler
  • model
  • info
  • image
  • bg_image
  • output_image
prompton the seaside
neg_prompt
steps50
seed0
width256
height256
obj_x50
obj_y50
bg_x200
bg_y200
polar0.0
azimuth0.0
batch_size1

This is the node that does the party trick. CustomNet_Sampler takes a photo of an object, strips the background off, and regenerates that object into a new scene - repositioned, resized, even viewed from a different angle - without training a LoRA or touching an optimizer. It's the payoff half of the smthemex/ComfyUI_CustomNet pack: CustomNet_LoadModel hands it a model plus a small info dict, you feed it an object image and a prompt, and out comes a 256×256 render that still looks like the thing you put in. If you've ever wanted a shoe sitting on a beach without copy-pasting it badly, this is the research-toy version of that dream.

Mechanically it's a faithful port of Tencent's CustomNet paper (late 2023), and knowing that explains most of its quirks. A carvekit background-matting model cuts your object out, crops to its bounding box, and pads it onto a white 256×256 canvas - which is exactly why the README insists white-background object photos work best. The cutout is encoded, pasted into the position your inputs define, and combined with a 4-number viewpoint vector built from the polar and azimuth angles. That vector is the whole idea: the model was trained to condition on it, so polar tilts the camera up and down and azimuth swings it left and right. Sampling runs through a DDIM sampler with CustomNet's own guidance recipe - a fixed CFG of 3.0 across image and text conditions, no dial for you.

Most of the inputs you can leave at defaults. The ones that matter:

  • image - the object photo; white background preferred.
  • prompt / neg_prompt - describe the scene, not the object. The default prompt is "on the seaside", so the object shows up wherever you tell it to.
  • obj_x, obj_y, bg_x, bg_y - the four corners of the box where the object lands on the 256×256 canvas. Defaults (50, 50, 200, 200) center it at a sensible size.
  • polar (-30..30) and azimuth (-60..30) - the viewpoint controls. This is the reason this pack exists.
  • bg_image - optional, and only used when the loaded model is the inpainting variant; the sampler checks the info dict to decide.

Two gotchas hiding in plain sight. width and height only resize the input before cutting out - the output is always 256×256, because the base model was trained at 256 and never got a bigger sibling. Plan to upscale after. And batch_size is there but mostly theatre: the source only returns the first sample, so values above 1 just burn compute.

Install is the same story as the loader - ComfyUI Manager (search ComfyUI_CustomNet) or clone into custom_nodes and restart. The heavy part is dependencies (carvekit-colab==4.1.0 pinned, plus taming-transformers from git) and first-run downloads: running this node fetches fba_matting.pth, tracer_b7.pth and CLIP ViT-L-14 into your user cache, and the README explicitly warns it needs a working internet connection for that. Also note the node always runs carvekit on your input - feeding it a pre-cutout image won't skip the matting step, just re-cuts it. CUDA is required.

One honest expectation-setter: CustomNet never went anywhere big. The only Reddit thread about it is the paper announcement from October 2023 at a score of 1, and these nodes have essentially zero search traffic. It's a fun experiment - put your sneaker on a beach, twist its angle, marvel that identity mostly survives - not a production compositing pipeline. Go in with that bar and you'll be pleasantly surprised.

CategoryCustomNet_Plus

Inputs (17)

NameTypeDefaultDescription
modelMODEL
infoDICT
imageIMAGE
promptSTRINGon the seaside
neg_promptSTRING
stepsINT501–1024
seedINT00–18446744073709550000
widthINT256128–512
heightINT256128–512
obj_xINT500–256
obj_yINT500–256
bg_xINT2000–256
bg_yINT2000–256
polarFLOAT0.0-30–30
azimuthFLOAT0.0-60–30
batch_sizeINT11–256
bg_imageoptIMAGE

Outputs (1)

NameTypeDescription
output_imageIMAGE