We propose ConicFlow, which frames constrained sampling from a flow matching model at inference time as an optimal control problem that balances deviation from the pretrained trajectory against reward, subject to hard terminal constraints. We discretize this problem and adapt receding-horizon control, optimizing only a short window of the trajectory at each step for computational tractability. We address the resulting sequence of receding-horizon subproblems with a receding-horizon primal-dual algorithm. Its dual multipliers capture the difficulty of satisfying each constraint and are refined throughout sampling, steering generation toward feasible final samples. We further propose a terminal-estimate variant that avoids accumulating local truncation errors by evaluating the reward and constraints at the predicted terminal point rather than at the end of the current horizon. Under standard regularity assumptions, we establish finite-horizon guarantees on suboptimality. Under convex-affine structure, we derive a sharper bound that scales linearly with omitted horizon length, and we show that the terminal-estimate variant is provably tighter when the flow dynamics change slowly. Experiments in both low- and high-dimensional settings with a recent large-scale flow matching model show that ConicFlow achieves high reward and strong constraint satisfaction while deviating less from the pretrained flow than recent baselines.
Figures & tables
Figure 1: Trade-off between terminal reward and total control cost, traced by varying the control-cost weight λ (upper left is better). λ value displayed on each point. Left: easy reward (upper moon). Middle: difficult reward (off-manifold). Right: uncontrolled sample distribution and both rewards.
Figure 2: Trade-off between terminal reward and total control cost. Left: Reward vs. control energy on the editing task, traced by sweeping λ (upper left is better). Right: Edits from each method at approximately matched reward; ConicFlow reaches the same reward with much lower control energy.
Method
CLIP (↑)
ImageReward (↑)
PickScore (↑)
ConicFlow
0.130±0.018
2.048±0.455
6.158±0.728
HardFlow
0.118±0.021
1.279±0.374
1.736±0.472
FMRG
0.065±0.008
1.278±0.504
2.670±0.073
Table 1: Mean reward gain over a shared energy budget. Each method’s reward–energy frontier, averaged over the control-energy range attained by all three methods and measured relative to the uncontrolled sample (units are those of rewards). Mean over n=4 (prompt, seed) pairs per reward.
Figure 3: Constrained image editing comparison. Top left: control energy vs. threshold multiplier m , median over (prompt, seed) pairs. Bottom left: feasibility rate vs. m . Middle: single-constraint edits with increasing m . Right: multi-constraint edits with increasing m .
Appendix figures & tables13 assets
Supplementary material from the paper’s appendix.
Appendix
Shared across methods
Steps N
16
Batch / seed
512 particles / 42 , shared across all runs
Base law p0
N(0,σd2I) , σd=0.750
Backbone
MLP, 3×256 GELU; EMA weights at 15 k steps
Per method
ConicFlow
horizon H
{1,2,4,8,16}
Appendix
Table 2: Hyperparameters for the low-dimensional experiments.
Shared across methods
Steps N / horizon H
8 / 2
Resolution / latent
256×256 / 16×32×32
Guidance scale
3.5
Precision
bf16 sampler, int8 transformer, fp32 reward
Reward models
CLIP, PickScore (both CLIP-ViT-H-14), ImageReward
Seeds / batch
42 and 7 / 1
Appendix
Table 3: Hyperparameters for the unconstrained image experiment (Fig 2 )
Shared across methods
Reward
none ( r≡0 ; objective is control energy)
Constraint scorer
PickScore, one head per attribute prompt
Constraint form
hi=τi−si≤0 , evaluated at the endpoint
Thresholds
τi=msi0 , Eq. ( 5 )
Steps N / horizon H
8 / 2
λ
20 (fixed)
Appendix
Table 4: Hyperparameters for the constrained image experiments. Everything not listed (sampler, resolution, precision, guidance scale) is as in Table 3 .
base prompt c
attribute prompts c1,…,cC
a portrait of a man
a smiling face
a photo of a golden retriever
a dog wearing sunglasses
a city street at noon
a city street at night
a portrait of a woman
a woman with bright red hair
a portrait of a woman
sad frowning woman
portrait of a young man with straight hair
man with curly hair; photo of very old man
Appendix
Table 5: Constrained instances. Each attribute prompt is one PickScore constraint ( 4 ); semicolons separate the constraints of an instance.
Instance (prompt → edit, seed)
runc
Budget [E1,E2]
ConicFlow
HardFlow
FMRG
CLIP
man → smiling, 42
0.149
[8.8,217]
0.151
0.135
0.083
man → smiling, 7
0.210
[8.2,136]
0.094
0.070
0.046
sleeping cat → open eyes, 42
0.247
[8.8,127]
0.106
0.101
0.065
green grass → red poppies, 42
0.127
[7.6,122]
0.171
0.166
0.066
mean ± s.e.
0.130±0.018
0.118±0.021
0.065±0.008
Appendix
Table 6: Per-problem breakdown of Table 1 .
Figure 4: Reward–effort trade-off on two further editing instances, N=8 , H=2 . The horizontal axis is control energy ∑k∥uk∥2Δt and the vertical axis the achieved reward r(xN) , so up and to the left is better. Each marker is one value of λ .
Figure 5: More examples of unconstrained editing. Each panel is one (reward, prompt, seed) instance at a matched-reward level. Panels 5(g) – 5(j) are the harder case: turning a green field red, or opening a sleeping cat’s eyes, asks for the image to be restructured rather than adjusted, and no method delivers it.
Figure 6: More examples of constrained editing. Each panel is one (prompt, seed) instance. Instance details are in Table 5 .
Figure 7: More examples of constrained editing. Each panel is one (prompt, seed) instance. Instance details are in Table 5 .
Figure 8: More examples of constrained editing. Each panel is one (prompt, seed) instance. Instance details are in Table 5 .
H
Δr
E
time
1
3.98
78.5
207 s
2
4.45
68.7
249 s
4
4.39
70.6
288 s
6
4.67
90.3
321 s
8
4.95
101.4
264 s
Appendix
Table 7: Planning horizon, editing, N=8 , seed 317 ; Δr , E and time are medians over the 24 operating points in each H . Wall clock is measured on shared cards and is indicative only.
ninner
time
Δr
E
ConicFlow
12
124 s
4.16
84.6
HardFlow
167
123 s
2.39
555.2
FMRG-J
13
128 s
1.84
32.5
Appendix
Table 8: Equal λ and equal wall clock, editing, N=8 , seeds 317 and 1289 ; Δr , E and time are medians.
objective at
time
Δr
E
ConicFlow
endpoint
238 s
4.79
68.7
horizon
90 s
3.25
86.9
HardFlow
—
36 s
2.00
553.9
FMRG-J
—
33 s
2.39
87.0
Appendix
Table 9: Where the horizon objective is evaluated, editing, N=8 , seeds 317 and 1289 ; Δr , E and time are medians.