Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 47cba6b

Browse files
committed
fix xyz with random seed
Signed-off-by: Vladimir Mandic <[email protected]>
1 parent c8dd137 commit 47cba6b

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Change Log for SD.Next
22

3-
## Update for 2025-09-18
3+
## Update for 2025-09-19
44

55
- **Models**
66
- [WAN 2.2 14B VACE](https://huggingface.co/alibaba-pai/Wan2.2-VACE-Fun-A14B)
@@ -22,8 +22,9 @@
2222
- **ipex** simplify internal implementation
2323
- refactor to use new libraries
2424
- **Fixes**
25-
- add explicit hf-login before framepack load
26-
- remove forced sampler from system info benchmark
25+
- framepack: add explicit hf-login before framepack load
26+
- benchmark: remove forced sampler from system info benchmark
27+
- xyz-grid: fix xyz grid with random seeds
2728

2829
## Update for 2025-09-15
2930

scripts/xyz_grid.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ def ui(self, is_img2img):
5454

5555
with gr.Row():
5656
with gr.Column():
57-
csv_mode = gr.Checkbox(label='Text inputs', value=False, elem_id=self.elem_id("csv_mode"), container=False)
58-
draw_legend = gr.Checkbox(label='Legend', value=True, elem_id=self.elem_id("draw_legend"), container=False)
59-
no_fixed_seeds = gr.Checkbox(label='Random seeds', value=False, elem_id=self.elem_id("no_fixed_seeds"), container=False)
57+
draw_legend = gr.Checkbox(label='Draw legend', value=True, elem_id=self.elem_id("draw_legend"), container=False)
58+
csv_mode = gr.Checkbox(label='Use text inputs', value=False, elem_id=self.elem_id("csv_mode"), container=False)
59+
no_fixed_seeds = gr.Checkbox(label='Use random seeds', value=False, elem_id=self.elem_id("no_fixed_seeds"), container=False)
6060
include_time = gr.Checkbox(label='Add time info', value=False, elem_id=self.elem_id("include_time"), container=False)
6161
include_text = gr.Checkbox(label='Add text info', value=False, elem_id=self.elem_id("include_text"), container=False)
6262
with gr.Column():
@@ -168,8 +168,6 @@ def run(self, p,
168168
create_video, video_type, video_duration, video_loop, video_pad, video_interpolate,
169169
): # pylint: disable=W0221
170170
jobid = shared.state.begin('XYZ Grid')
171-
if not no_fixed_seeds:
172-
processing.fix_seed(p)
173171
if not shared.opts.return_grid:
174172
p.batch_size = 1
175173

@@ -251,6 +249,8 @@ def fix_axis_seeds(axis_opt, axis_list):
251249
xs = fix_axis_seeds(x_opt, xs)
252250
ys = fix_axis_seeds(y_opt, ys)
253251
zs = fix_axis_seeds(z_opt, zs)
252+
else:
253+
processing.fix_seed(p)
254254

255255
total_jobs = len(xs) * len(ys) * len(zs)
256256
if x_opt.label == 'Steps':

scripts/xyz_grid_on.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,11 @@ def cell(x, y, z, ix, iy, iz):
329329
pc = copy(p)
330330
pc.override_settings_restore_afterwards = False
331331
pc.styles = pc.styles[:]
332+
if no_fixed_seeds:
333+
pc.seed = -1
334+
processing.fix_seed(pc)
335+
pc.all_seeds = None
336+
pc.all_subseeds = None
332337
x_opt.apply(pc, x, xs)
333338
y_opt.apply(pc, y, ys)
334339
z_opt.apply(pc, z, zs)

0 commit comments

Comments
 (0)