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;
|
return controlImageArr;
|
||||||
}, [sampleItem, imgPath]);
|
}, [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
|
// keyboard events while open
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleKeyDown = (event: KeyboardEvent) => {
|
const handleKeyDown = (event: KeyboardEvent) => {
|
||||||
@@ -206,6 +215,9 @@ export default function SampleImageViewer({ imgPath, numSamples, sampleImages, s
|
|||||||
<div>
|
<div>
|
||||||
<span className="text-gray-400">Sample #:</span> {imgInfo.promptIdx + 1}
|
<span className="text-gray-400">Sample #:</span> {imgInfo.promptIdx + 1}
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<span className="text-gray-400">Seed:</span> {seed}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</DialogPanel>
|
</DialogPanel>
|
||||||
|
|||||||
Reference in New Issue
Block a user