Add seed to the sample image modal
This commit is contained in:
parent
f0646a0a70
commit
4e207d92cd
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue