mirror of
https://github.com/ostris/ai-toolkit.git
synced 2026-01-26 16:39:47 +00:00
Add seed to the sample image modal
This commit is contained in:
@@ -123,6 +123,15 @@ export default function SampleImageViewer({ imgPath, numSamples, sampleImages, s
|
||||
return controlImageArr;
|
||||
}, [sampleItem, imgPath]);
|
||||
|
||||
const seed = useMemo(() => {
|
||||
if (!sampleItem) return '?';
|
||||
if (sampleItem.seed !== undefined) return sampleItem.seed;
|
||||
if (sampleConfig?.walk_seed) {
|
||||
return sampleConfig.seed + imgInfo.promptIdx;
|
||||
}
|
||||
return sampleConfig?.seed ?? '?';
|
||||
}, [sampleItem, sampleConfig]);
|
||||
|
||||
// keyboard events while open
|
||||
useEffect(() => {
|
||||
const handleKeyDown = (event: KeyboardEvent) => {
|
||||
@@ -206,6 +215,9 @@ export default function SampleImageViewer({ imgPath, numSamples, sampleImages, s
|
||||
<div>
|
||||
<span className="text-gray-400">Sample #:</span> {imgInfo.promptIdx + 1}
|
||||
</div>
|
||||
<div>
|
||||
<span className="text-gray-400">Seed:</span> {seed}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</DialogPanel>
|
||||
|
||||
Reference in New Issue
Block a user