Skip to content

Commit 8674455

Browse files
author
David Khristepher Santos
committed
Fix for Seed being parsed as an int
1 parent 0420ba4 commit 8674455

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

Diffusion.Scanner/Metadata.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,18 @@ decimal GetDecimalTag(string key)
619619
return 0m;
620620
}
621621

622+
long GetLongTag(string key)
623+
{
624+
if (TryFindTag(directories, "PNG-tEXt", "Textual Data", tag => tag.Description.StartsWith($"{key}: "), out var tag))
625+
{
626+
workflowBuilder.AppendLine(tag.Description);
627+
var value = tag.Description.Substring($"{key}: ".Length);
628+
629+
return long.Parse(value);
630+
}
631+
632+
return 0;
633+
}
622634

623635
int GetIntTag(string key)
624636
{
@@ -639,7 +651,7 @@ int GetIntTag(string key)
639651
fp.Height = GetIntTag("height");
640652
fp.Steps = GetIntTag("num_inference_steps");
641653
fp.CFGScale = GetDecimalTag("guidance_scale");
642-
fp.Seed = GetIntTag("seed");
654+
fp.Seed = GetLongTag("seed");
643655
fp.Sampler = GetTag("sampler_name");
644656
fp.Model = GetTag("use_stable_diffusion_model");
645657

0 commit comments

Comments
 (0)