Nodes/arkennemasis - ChatGPT / Codex / fal AI nodes/arkennemasis fal · Flux General RF Inversion · per compute second
ComfyUI Node

arkennemasis fal · Flux General RF Inversion · per compute second

Edit a photo by taking it apart and putting it back differently

By Hishamahmer·Created 3 months ago·Updated 9 days ago· 11
arkennemasis fal · Flux General RF Inversion · per compute second
  • image
  • fill_image_fill_image_1
  • fill_image_fill_image_2
  • fill_image_fill_image_3
  • fill_image_fill_image_4
  • fill_image_fill_image_5
  • fill_image_fill_image_6
  • reference_image
  • images
  • image_paths
  • timings
  • has_nsfw_concepts
  • prompt
  • seed
  • info
◄prompt►
◄image_sizesquare_hd►
◄image_size_width1024►
◄image_size_height1024►
◄num_inference_steps28►
◄seed-1►
◄loras►
◄control_loras►
◄controlnets►
◄controlnet_unions►
◄easycontrols►
◄guidance_scale3.50►
◄use_cfg_zerofalse►
◄num_images1►
◄enable_safety_checkertrue►
◄reference_strength0.65►
◄reference_start0.00►
◄reference_end1.00►
◄base_shift0.50►
◄max_shift1.15►
◄output_formatpng►
◄use_beta_schedulefalse►
◄schedulereuler►
◄negative_prompt►
◄nag_scale3.00►
◄nag_tau2.50►
◄nag_alpha0.25►
◄nag_end0.25►
◄controller_guidance_forward0.60►
◄controller_guidance_reverse0.75►
◄reverse_guidance_start0►
◄reverse_guidance_end8►
◄reverse_guidance_scheduleconstant►
◄max_cost_usd20.0►
◄reuse_identical_runtrue►
◄extra_json►
◄max_concurrent1►

RF Inversion is the most technical thing in this pack, and the least likely to be what you actually wanted.

Here's the idea in one paragraph. Flow models like Flux generate by walking from noise to an image along a trajectory. Inversion runs that walk backwards on a photograph - it finds the noise trajectory that would have produced your picture - and then you re-run the forward walk with a new prompt. Because you're editing inside the model's own latent journey rather than pasting a denoise on top, you can change the semantic content while the structure stays anchored to the original. It's the difference between "restyle this photo" and "this photo, but now it's autumn, and it's still the same photo".

How the controls map to that

This endpoint exposes the inversion controller directly, and the two guidance values do different jobs:

  • controller_guidance_forward (default 0.6, gamma) - used in the creation of the structured noise.
  • controller_guidance_reverse (default 0.75, eta) - used during denoising, and the tooltip gives you the direction: values closer to 1 push the result closer to the input.
  • reverse_guidance_start (0) and reverse_guidance_end (8) - the timestep window where that reverse guidance applies. Same idea as releasing a ControlNet once composition is settled: you can hold the subject through the early steps and let the model work freely later.
  • reverse_guidance_schedule (default constant) - how that guidance is applied across the window.

If you've ever used a ControlNet start/end step and understood it as "when does the condition stop mattering", you already have the mental model for these four fields. The forward/reverse pair is the one to nudge first: crank reverse toward 1 and the picture barely moves; drop it and the edit becomes a new image wearing the original's bones.

The rest of the node

prompt is the edit instruction, image is the photograph being edited, and both are required. Then the general endpoint's whole drawer: negative_prompt through NAG (nag_scale 3 - don't exceed it - plus nag_tau 2.5, nag_alpha 0.25, nag_end 0.25), the JSON extension fields (loras, control_loras, controlnets, controlnet_unions, easycontrols - URLs fal can reach, empty leaves them out), use_cfg_zero, reference_image with its strength/start/end window, six optional fill_image_* sockets, and the sampling set: image_size (square_hd default, custom for exact dimensions), num_inference_steps 28, seed -1, guidance_scale 3.5, scheduler euler, base_shift 0.5, max_shift 1.15, use_beta_schedule false, output_format png. num_images is capped at 1.

Note what's not here: strength. You're not denoising a percentage of anything - the whole method is the inversion. If you want a dial that says "how much of the original survives", use the general image-to-image node instead.

Outputs

images, image_paths (saved in output/fal/fal-ai_flux-general_rf-inversion/), plus timings, has_nsfw_concepts, prompt, seed, and info with the request id, cost estimate, saved files and fal's full answer.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/Hishamahmer/comfyui-arkennemasis

Restart ComfyUI, or install through ComfyUI-Manager → Install via Git URL. The pack's requirements.txt declares httpx, and only the Codex nodes need it - the fal provider speaks plain HTTP with the standard library and downloads nothing.

FAL_KEY=your-key-from-fal.ai/dashboard/keys

goes in the .env next to run_nvidia_gpu.bat (portable build) or the ComfyUI folder. No key widget on any fal node here, deliberately, so a key can't end up in a workflow you share.

The price problem, which is the honest reason to think twice

This endpoint is billed per compute second and fal publishes no per-run figure - the node's title says "per compute second" for that reason. The consequence is concrete: max_cost_usd cannot protect you here. The default $20 cap works by comparing an estimate against the cap before uploading, and this node has no estimate to compare. Same for the differential-diffusion endpoint in this pack.

So treat it as a node you run deliberately, one call at a time (max_concurrent defaults to 1, and that's the right setting), not something to fan out across forty branches. reuse_identical_run (default on) is your best cost control: same image bytes plus same settings returns the file you already paid for.

Should you actually use this?

Honestly: probably not first. Instruction editing (Kontext, Flux 2 Edit) covers "change the jacket, swap the background" more simply and you can see what you're doing. RF Inversion's reason to exist is edits where the structure must survive while the semantics change - the same photo, fundamentally re-described - and where a plain img2img restyle would drift the layout.

If you want that, this is the version of it that's actually implemented as an inversion rather than a denoise, and there is no local ComfyUI equivalent most people have installed. If you just want "this photo but better light", go home early and use image-to-image.

Categoryarkennemasis/fal/Image/Flux

Inputs (45)

NameTypeDefaultDescription
promptSTRINGThe prompt to edit the image with
image_sizeCOMBOsquare_hdThe size of the generated image. 'custom' uses the width and height below.
image_size_widthINT102416–14142Width in pixels when image_size is 'custom'.
image_size_heightINT102416–14142Height in pixels when image_size is 'custom'.
num_inference_stepsINT281–50The number of inference steps to perform.
seedINT-1-1–2147483647The same seed and the same prompt given to the same version of the model will output the same image every time. -1 leaves it to the model.
lorasSTRINGThe LoRAs to use for the image generation. You can use any number of LoRAs and they will be merged together to generate the final image. JSON. Empty leaves it out.
control_lorasSTRINGThe LoRAs to use for the image generation which use a control image. You can use any number of LoRAs and they will be merged together to generate the final image. JSON. Empty leaves it out.
controlnetsSTRINGThe controlnets to use for the image generation. Only one controlnet is supported at the moment. JSON. Empty leaves it out.
controlnet_unionsSTRINGThe controlnet unions to use for the image generation. Only one controlnet is supported at the moment. JSON. Empty leaves it out.
easycontrolsSTRINGEasyControl Inputs to use for image generation. JSON. Empty leaves it out.
guidance_scaleFLOAT3.500–20The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you.
use_cfg_zeroBOOLEANfalseUses CFG-zero init sampling as in https://arxiv.org/abs/2503.18886.
num_imagesINT11–10The number of images to generate. This is always set to 1 for streaming output.
enable_safety_checkerBOOLEANtrueIf set to true, the safety checker will be enabled. Disabling it requires account authorization; unauthorized requests are always checked, and images flagged as unsafe are returned as black images.
reference_strengthFLOAT0.65-3–3Strength of reference_only generation. Only used if a reference image is provided.
reference_startFLOAT0.000–1The percentage of the total timesteps when the reference guidance is to bestarted.
reference_endFLOAT1.000–1The percentage of the total timesteps when the reference guidance is to be ended.
base_shiftFLOAT0.500.01–5Base shift for the scheduled timesteps
max_shiftFLOAT1.150.01–5Max shift for the scheduled timesteps
output_formatCOMBOpngThe format of the generated image.
use_beta_scheduleBOOLEANfalseSpecifies whether beta sigmas ought to be used.
schedulerCOMBOeulerScheduler for the denoising process.
negative_promptSTRINGNegative prompt to steer the image generation away from unwanted features. By default, we will be using NAG for processing the negative prompt. Empty leaves it out.
nag_scaleFLOAT3.001.01–10The scale for NAG. Higher values will result in a image that is more distant to the negative prompt.
nag_tauFLOAT2.50The tau for NAG. Controls the normalization of the hidden state. Higher values will result in a less aggressive normalization, but may also lead to unexpected changes with respect to the original image. Not recommended to change this value.
nag_alphaFLOAT0.250.01–1The alpha value for NAG. This value is used as a final weighting factor for steering the normalized guidance (positive and negative prompts) in the direction of the positive prompt. Higher values will result in less steering on the normalized guidance where lower values will result in considering the positive prompt guidance more.
nag_endFLOAT0.250.01–1The proportion of steps to apply NAG. After the specified proportion of steps has been iterated, the remaining steps will use original attention processors in FLUX.
imageIMAGEURL of image to be edited
controller_guidance_forwardFLOAT0.600.01–3The controller guidance (gamma) used in the creation of structured noise.
controller_guidance_reverseFLOAT0.750.01–3The controller guidance (eta) used in the denoising process.Using values closer to 1 will result in an image closer to input.
reverse_guidance_startINT0Timestep to start guidance during reverse process.
reverse_guidance_endINT8Timestep to stop guidance during reverse process.
reverse_guidance_scheduleCOMBOconstantScheduler for applying reverse guidance.
fill_image_fill_image_1optIMAGEURLs of images to be filled for redux prompting Each socket may carry a batch; they are sent in socket order (the first picture of socket 1 is number 1).
fill_image_fill_image_2optIMAGEURLs of images to be filled for redux prompting Each socket may carry a batch; they are sent in socket order (the first picture of socket 1 is number 1).
fill_image_fill_image_3optIMAGEURLs of images to be filled for redux prompting Each socket may carry a batch; they are sent in socket order (the first picture of socket 1 is number 1).
fill_image_fill_image_4optIMAGEURLs of images to be filled for redux prompting Each socket may carry a batch; they are sent in socket order (the first picture of socket 1 is number 1).
fill_image_fill_image_5optIMAGEURLs of images to be filled for redux prompting Each socket may carry a batch; they are sent in socket order (the first picture of socket 1 is number 1).
fill_image_fill_image_6optIMAGEURLs of images to be filled for redux prompting Each socket may carry a batch; they are sent in socket order (the first picture of socket 1 is number 1).
reference_imageoptIMAGEURL of Image for Reference-Only
max_cost_usdoptFLOAT20.00–100000Safety cap. If the estimated cost of this run is above this many US dollars the node stops BEFORE sending anything to fal. 0 = no cap.
reuse_identical_runoptBOOLEANtrueIf these exact inputs (the settings AND the same pictures/clips/audio) were already paid for and the files are still in output/fal, return them instead of paying again - also after a ComfyUI restart. Turn off for a fresh take with the same settings.
extra_jsonoptSTRINGAdvanced: a JSON object merged into the request last, for any fal field this node has no box for. Example: {"seed": 7}. Leave empty normally.
max_concurrentoptINT11–32How many paid fal calls may run at the same time in one run, across every fal node. 1 (default) = one after another. This node starts its paid part only while fewer than this many fal calls are running. Once any fal node fails, the ones still waiting are not started, so nothing more is billed.

Outputs (7)

NameTypeDescription
imagesIMAGE—
image_pathsSTRING—
timingsSTRING—
has_nsfw_conceptsSTRING—
promptSTRING—
seedINT—
infoSTRINGJSON: request id, cost estimate, saved files and fal's full answer.