Sampling from a diffusion model typically requires many forward passes through a large neural network, making generation computationally expensive. While much work has focused on efficient solvers and samplers, comparatively little attention has been paid to selecting the sampling timesteps themselves. A recent line of work optimizes theoretically derived surrogates for sample quality rather than the quality metric itself. We propose Optimizing Your Sampling (OYS), which instead treats timestep selection as a black-box optimization problem, optimizing the target metric directly with Bayesian optimization. OYS outperforms both the default schedules and those of Align Your Steps on text-to-image generation, and improves over the default schedules on inpainting and other image tasks, in both quantitative and human evaluations. OYS requires no additional training, is applicable even to distilled models, and improves both simple and sophisticated samplers such as Euler and DPM-Solver++. A 5-step OYS schedule retains 89%-94% of the quality of a 50-step schedule while reducing inference cost by 10x.
Figures & tables
Figure 1: Qualitative comparisons between Default, AYS ( Sabour et al., 2024 ) , and ours (OYS) using a 5 step sampling schedule. All prompts are held-out test examples, unseen during schedule optimization for either method.
Figure 2: Overview of our Optimize Your Sampling (OYS) framework using Bayesian Optimization. The process begins with Acquisition Maximization (top left), where promising sampling configurations are identified. The selected configuration undergoes Black Box Metric Evaluation (right). This consists of generating images with the diffusion model and scoring them using metrics like FID and HPS. Results update the surrogate model’s posterior distribution (bottom left), refining our understanding of the configuration space. This cycle repeats until convergence or budget exhaustion, efficiently discovering effective sampling parameters.
Table 3
Figure 3: Text-to-Image User Study. Percent Win Rate on SDXL measuring image fidelity and image alignment. Significance was assessed with two-sided exact binomial tests on the win and lose counts, excluding ties, with all differences being highly significant ( p<0.001 ). OYS significantly outperforms both AYS and default sampling in quality (68.8% win rate vs. AYS, 70.6% vs. Default; ties split equally) and in alignment (62.9% win rate vs. AYS, 66.8% vs. Default).
Figure 4: Inpainting Results for SDv1.5 and SDXL against default and OYS schedule. OYS reconstructions remain faithful to the unmasked regions, whereas the 5-step default schedule visibly corrupts the full image.
Figure 5: 5-step text-to-image sampling schedules in log-SNR space. AYS closely tracks the default schedule’s near-uniform log-SNR spacing, while OYS consistently places more steps at low log-SNR, i.e., high noise levels.
Task
Method
PSNR ↑
HPS Average ↑
HPS Win Rate ↑
Inverse HED
Default
59.79
0.197
-
OYS
60.46
0.206
65.43%
Inverse Depth
Default
58.51
0.198
-
OYS
59.05
0.202
57.62%
Inverse Segment
Default
57.97
0.196
-
OYS
57.60
0.201
58.80%
Table 4: Prompt Diffusion. PSNR, HPS, and Win Rate on Inverse HED, Inverse Depth, and Inverse Segmentation comparing Default and OYS schedules. HPS Win Rates are with respect to the Default Schedule.
Figure 8
Figure 8: Prompt Diffusion Results for Inverse Depth and Inverse HED against default and OYS schedule. Best viewed in color.
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
Method
Sampler
Steps
HPS Average ↑
OYS vs. Row HPS Win Rate ↑
Default
EA/ED
1
0.277
83.94%
Default
ED
3
0.287
83.35%
Default
EA
3
0.287
78.55%
OYS
ED
3
0.298
-
Appendix
Table 5: SDXL-Turbo Results. Mean HPS across the COCO Captions validation split and the HPS win rate of OYS (3-step, ED) against each default baseline. ED and EA denote Euler Discrete and Euler Ancestral, respectively.
Table 11
Figure 9: User Study Template. Instructions and question format used in our user study for evaluating image pairs.
Model
σmin
σmax
ρ
EMA length
Guidance
EDM2-XS
Default
0.002
80.0
7.0
0.045
1.40
OYS
0.0001
20.0
4.976
0.025
1.758
EDM2-S
Default
0.002
80.0
7.0
0.025
1.40
OYS
0.010
22.132
9.767
0.028
1.659
Appendix
Table 9: EDM2 Sampling Configurations. Comparison of the default and OYS-optimized sampling configurations for each EDM2 model size.
Notation
Definition
Problem setup
X
Set of task inputs (e.g., text prompts) used for tuning
m
Sampling function of the fixed, pretrained diffusion model
e
Black-box evaluation metric
p
Sampling configuration, p={p1,…,pM} ; the parameters OYS optimizes
pk
k -th element of p ; pk∈[0,1] for the schedule parameters
Appendix
Table 10: Notation. Summary of the notation used throughout the paper.
Text-to-image diffusion models expose many inference-time sampling parameters, including prompts, negative prompts, classifier-free guidance scales, and noise schedules. These parameters are typically manually chosen once and then held fixed across prompts and denoising timesteps, even though different prompts and stages of generation can benefit from different parameter values. We introduce LeSAMP, a framework for learning prompt-conditioned, timestep-varying sampling parameters. We formulate parameter selection as a reinforcement learning problem: Given a user prompt, a large language model is trained to emit schedules for the chosen sampling parameters. We optimize our model using rewards from human preference models and VLM-as-a-judge. We evaluate our model on Flux.1 [dev] and Stable Diffusion 3.5, and find that compared to baselines, LeSAMP has a win rate of up to 68.12% using human preference scores and 73.37% using VLM-as-a-judge. These gains are validated in a user study where we achieve win rates of up to 59.46% over previous baselines. Our results suggest that learned sampling-parameter policies provide a complementary approach to existing post-training methods for improving diffusion model outputs.
Text-to-image diffusion models have achieved unprecedented success but still struggle to produce high-quality results under limited sampling budgets. Existing training-free sampling acceleration methods are typically developed independently, leaving the overall performance and compatibility among these methods unexplored. In this paper, we bridge this gap by systematically elucidating the design space, and our comprehensive experiments identify the sampling time schedule as the most pivotal factor. Inspired by the geometric properties of diffusion models revealed through the Frenet-Serret formulas, we propose constant total rotation schedule (TORS), a scheduling strategy that ensures uniform geometric variation along the sampling trajectory. TORS outperforms previous training-free acceleration methods and produces high-quality images with 10 sampling steps on Flux.1-Dev and Stable Diffusion 3.5. Extensive experiments underscore the adaptability of our method to unseen models, hyperparameters, and downstream applications. Code is available at https://github.com/zju-pi/TORS.
Zhenyu Zhou, Defang Chen, Siwei Lyu +2
State Key Laboratory of Blockchain and Data Security, Zhejiang University · Hangzhou High-Tech Zone (Binjiang) Institute of Blockchain and Data Security · University of California, Berkeley +1
Diffusion models generate conditional samples by progressively denoising Gaussian noise, yet the denoising trajectory can stall at visually plausible but low-quality outcomes with conditional misalignment or structural artifacts. We interpret this behavior as local optima in a surrogate quality landscape: Once early denoising commits to a suboptimal global structure, later steps mainly sharpen details and seldom correct the underlying mistake. While existing inference-time approaches explore alternative diffusion states via re-noising with fixed strength or direction, they exhibit limited capacity to escape steep quality plateaus. We propose Controlled Random Zigzag Sampling (Ctrl-Z Sampling),a scalable sampling strategy that detects plateaus in quality landscape via a surrogate score, and allocates exploration only when a plateau is detected. Upon detection, Ctrl-Z Sampling rolls back to noisier states, samples a set of alternative continuations, and updates the trajectory when a candidate improves the score, otherwise escalating the exploration depth to escape the current plateau. The proposed method is model-agnostic and broadly compatible with existing diffusion frameworks. Experiments show that Ctrl-Z Sampling consistently improves generation quality over other inference-time scaling samplers across different NFE budgets, offering a scalable compute-quality trade-off. Code available at: https://github.com/ShunqiM/Ctrl-Z-Sampling.
Shunqi Mao, Wei Guo, Chaoyi Zhang +3
School of Computer Science, The University of Sydney, Australia