Add sample_start_step setting to configure when sampling starts (#949)

Co-authored-by: Jaret Burkett <jaretburkett@gmail.com>
This commit is contained in:
fatalis
2026-07-15 12:15:50 -05:00
committed by GitHub
parent 4ece17b71f
commit 8bbd051667
31 changed files with 46 additions and 2 deletions

View File

@@ -70,6 +70,7 @@ config:
sample:
sampler: "flowmatch" # must match train.noise_scheduler
sample_every: 250 # sample every this many steps
sample_start_step: 0 # start sampling at this step
width: 1024
height: 1024
prompts:

View File

@@ -72,6 +72,7 @@ config:
sample:
sampler: "flowmatch" # must match train.noise_scheduler
sample_every: 250 # sample every this many steps
sample_start_step: 0 # start sampling at this step
width: 1024
height: 1024
prompts:

View File

@@ -85,6 +85,7 @@ config:
sample:
sampler: "flowmatch" # must match train.noise_scheduler
sample_every: 250 # sample every this many steps
sample_start_step: 0 # start sampling at this step
width: 1024
height: 1024
# I leave half blank to test prompt and unprompted

View File

@@ -81,6 +81,7 @@ config:
sample:
sampler: "flowmatch" # must match train.noise_scheduler
sample_every: 250 # sample every this many steps
sample_start_step: 0 # start sampling at this step
width: 1024
height: 1024
prompts:

View File

@@ -73,6 +73,7 @@ config:
sample:
sampler: "flowmatch" # must match train.noise_scheduler
sample_every: 250 # sample every this many steps
sample_start_step: 0 # start sampling at this step
width: 1024
height: 1024
prompts:

View File

@@ -78,6 +78,7 @@ config:
sample:
sampler: "flowmatch" # must match train.noise_scheduler
sample_every: 250 # sample every this many steps
sample_start_step: 0 # start sampling at this step
width: 1024
height: 1024
prompts:

View File

@@ -129,6 +129,7 @@ config:
sample:
sampler: "flowmatch" # must match train.noise_scheduler
sample_every: 250 # sample every this many steps
sample_start_step: 0 # start sampling at this step
width: 1024
height: 1024
prompts:

View File

@@ -75,6 +75,7 @@ config:
sample:
sampler: "flowmatch" # must match train.noise_scheduler
sample_every: 250 # sample every this many steps
sample_start_step: 0 # start sampling at this step
width: 1024
height: 1024
prompts:

View File

@@ -70,6 +70,7 @@ config:
sample:
sampler: "flowmatch" # must match train.noise_scheduler
sample_every: 250 # sample every this many steps
sample_start_step: 0 # start sampling at this step
width: 1024
height: 1024
prompts:

View File

@@ -79,6 +79,7 @@ config:
sample:
sampler: "flowmatch" # must match train.noise_scheduler
sample_every: 250 # sample every this many steps
sample_start_step: 0 # start sampling at this step
width: 1024
height: 1024
prompts:

View File

@@ -72,6 +72,7 @@ config:
sample:
sampler: "flowmatch" # must match train.noise_scheduler
sample_every: 250 # sample every this many steps
sample_start_step: 0 # start sampling at this step
width: 1024
height: 1024
prompts:

View File

@@ -86,6 +86,7 @@ config:
sample:
sampler: "flowmatch" # must match train.noise_scheduler
sample_every: 250 # sample every this many steps
sample_start_step: 0 # start sampling at this step
width: 1024
height: 1024
prompts:

View File

@@ -70,6 +70,7 @@ config:
sample:
sampler: "flowmatch" # must match train.noise_scheduler
sample_every: 250 # sample every this many steps
sample_start_step: 0 # start sampling at this step
width: 1024
height: 1024
prompts:

View File

@@ -68,6 +68,7 @@ config:
sample:
sampler: "flowmatch" # must match train.noise_scheduler
sample_every: 250 # sample every this many steps
sample_start_step: 0 # start sampling at this step
width: 1024
height: 1024
prompts:

View File

@@ -69,6 +69,7 @@ config:
sample:
sampler: "flowmatch" # must match train.noise_scheduler
sample_every: 250 # sample every this many steps
sample_start_step: 0 # start sampling at this step
width: 1024
height: 1024
prompts:

View File

@@ -70,6 +70,7 @@ config:
sample:
sampler: "flowmatch" # must match train.noise_scheduler
sample_every: 250 # sample every this many steps
sample_start_step: 0 # start sampling at this step
width: 1024
height: 1024
# you can provide up to 3 control images here

View File

@@ -68,6 +68,7 @@ config:
sample:
sampler: "flowmatch" # must match train.noise_scheduler
sample_every: 250 # sample every this many steps
sample_start_step: 0 # start sampling at this step
width: 1024
height: 1024
samples:

View File

@@ -71,6 +71,7 @@ config:
sample:
sampler: "flowmatch" # must match train.noise_scheduler
sample_every: 250 # sample every this many steps
sample_start_step: 0 # start sampling at this step
width: 1024
height: 1024
prompts:

View File

@@ -80,6 +80,7 @@ config:
sample:
sampler: "flowmatch"
sample_every: 250 # sample every this many steps
sample_start_step: 0 # start sampling at this step
width: 832
height: 480
num_frames: 40

View File

@@ -69,6 +69,7 @@ config:
sample:
sampler: "flowmatch"
sample_every: 250 # sample every this many steps
sample_start_step: 0 # start sampling at this step
width: 832
height: 480
num_frames: 40

View File

@@ -80,6 +80,7 @@ config:
sample:
sampler: "flowmatch"
sample_every: 250 # sample every this many steps
sample_start_step: 0 # start sampling at this step
width: 1024
height: 1024
# set to 1 for images

View File

@@ -52,6 +52,7 @@ config:
sample:
sampler: "ddpm" # must match train.noise_scheduler
sample_every: 100 # sample every this many steps
sample_start_step: 0 # start sampling at this step
width: 512
height: 512
prompts:

View File

@@ -52,6 +52,7 @@ config:
sample:
sampler: "ddpm" # must match train.noise_scheduler
sample_every: 100 # sample every this many steps
sample_start_step: 0 # start sampling at this step
width: 512
height: 512
prompts:

View File

@@ -41,6 +41,7 @@ config:
sample:
sampler: "ddpm" # must match train.noise_scheduler
sample_every: 100 # sample every this many steps
sample_start_step: 0 # start sampling at this step
width: 512
height: 512
prompts:

View File

@@ -52,6 +52,7 @@ config:
sample:
sampler: "ddpm" # must match train.noise_scheduler
sample_every: 100 # sample every this many steps
sample_start_step: 0 # start sampling at this step
width: 512
height: 512
prompts:

View File

@@ -41,6 +41,7 @@ config:
sample:
sampler: "ddpm" # must match train.noise_scheduler
sample_every: 100 # sample every this many steps
sample_start_step: 0 # start sampling at this step
width: 512
height: 512
prompts:

View File

@@ -2371,7 +2371,11 @@ class BaseSDTrainProcess(BaseTrainProcess):
# todo improve this logic to send one of each through if we can buckets and batch size might be an issue
is_reg_step = False
is_save_step = self.save_config.save_every and self.step_num % self.save_config.save_every == 0
is_sample_step = self.sample_config.sample_every and self.step_num % self.sample_config.sample_every == 0
is_sample_step = (
self.sample_config.sample_every
and self.step_num >= self.sample_config.sample_start_step
and self.step_num % self.sample_config.sample_every == 0
)
if self.train_config.disable_sampling:
is_sample_step = False

View File

@@ -80,6 +80,7 @@ class SampleConfig:
def __init__(self, **kwargs):
self.sampler: str = kwargs.get('sampler', 'ddpm')
self.sample_every: int = kwargs.get('sample_every', 100)
self.sample_start_step: int = kwargs.get('sample_start_step', 0)
self.width: int = kwargs.get('width', 512)
self.height: int = kwargs.get('height', 512)
self.neg = kwargs.get('neg', False)

View File

@@ -1182,6 +1182,15 @@ export default function SimpleJob({
min={1}
required
/>
<NumberInput
label="Sample Start Step"
value={jobConfig.config.process[0].sample.sample_start_step ?? 0}
onChange={value => setJobConfig(value, 'config.process[0].sample.sample_start_step')}
placeholder="eg. 0"
className="pt-2"
min={0}
required
/>
<SelectInput
label="Sampler"
className="pt-2"

View File

@@ -3,6 +3,7 @@ import { SampleConfig } from "@/types";
export const defaultSampleConfig: SampleConfig = {
sampler: 'flowmatch',
sample_every: 250,
sample_start_step: 0,
width: 1024,
height: 1024,
samples: [
@@ -52,6 +53,7 @@ export const defaultSampleConfig: SampleConfig = {
export const defaultAudioSampleConfig: SampleConfig = {
sampler: 'flowmatch',
sample_every: 250,
sample_start_step: 0,
width: 1024,
height: 1024,
samples: [
@@ -406,6 +408,7 @@ It's Converging!
export const defaultIdeogramSamplesConfig: SampleConfig = {
sampler: 'flowmatch',
sample_every: 250,
sample_start_step: 0,
width: 1024,
height: 1024,
samples: [
@@ -973,4 +976,4 @@ export const defaultIdeogramSamplesConfig: SampleConfig = {
sample_steps: 30,
num_frames: 1,
fps: 1,
}
}

View File

@@ -201,6 +201,7 @@ export interface SampleItem {
export interface SampleConfig {
sampler: string;
sample_every: number;
sample_start_step: number;
width: number;
height: number;
prompts?: string[];