Skip to content

Commit 6b46cb5

Browse files
authored
Merge pull request LykosAI#753 from ionite34/fix-batch-seed
Fix batch count seed increments not being recorded in project or image metadata
2 parents fd1da21 + 419e617 commit 6b46cb5

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2
6565
### Fixed
6666
- Fixed incorrect IPAdapter download links in the HuggingFace model browser
6767
- Fixed potential memory leak of transient controls (Inference Prompt and Output Image Viewer) not being garbage collected due to event subscriptions
68+
- Fixed Batch Count seeds not being recorded properly in Inference projects and image metadata
6869

6970
## v2.11.5
7071
### Added

StabilityMatrix.Avalonia/ViewModels/Inference/InferenceTextToImageViewModel.cs

+12-2
Original file line numberDiff line numberDiff line change
@@ -242,13 +242,23 @@ CancellationToken cancellationToken
242242
var buildPromptArgs = new BuildPromptEventArgs { Overrides = overrides, SeedOverride = seed };
243243
BuildPrompt(buildPromptArgs);
244244

245+
// update seed in project for batches
246+
var inferenceProject = InferenceProjectDocument.FromLoadable(this);
247+
if (inferenceProject.State?["Seed"]?["Seed"] is not null)
248+
{
249+
inferenceProject = inferenceProject.WithState(x => x["Seed"]["Seed"] = seed);
250+
}
251+
245252
var generationArgs = new ImageGenerationEventArgs
246253
{
247254
Client = ClientManager.Client,
248255
Nodes = buildPromptArgs.Builder.ToNodeDictionary(),
249256
OutputNodeNames = buildPromptArgs.Builder.Connections.OutputNodeNames.ToArray(),
250-
Parameters = SaveStateToParameters(new GenerationParameters()),
251-
Project = InferenceProjectDocument.FromLoadable(this),
257+
Parameters = SaveStateToParameters(new GenerationParameters()) with
258+
{
259+
Seed = Convert.ToUInt64(seed)
260+
},
261+
Project = inferenceProject,
252262
FilesToTransfer = buildPromptArgs.FilesToTransfer,
253263
BatchIndex = i,
254264
// Only clear output images on the first batch

0 commit comments

Comments
 (0)