feat(ui): display prompt when debugging regions

This commit is contained in:
psychedelicious 2024-04-17 14:44:56 +10:00 committed by Kent Keirsey
parent c9bf00b80b
commit ff7aa2558a

View File

@ -34,6 +34,8 @@ export const getRegionalPromptLayerBlobs = async (
if (layerIds && !layerIds.includes(layer.id())) {
continue;
}
const reduxLayer = state.regionalPrompts.layers.find((l) => l.id === layer.id());
assert(reduxLayer, `Redux layer ${layer.id()} not found`);
stage.add(layer);
const blob = await new Promise<Blob>((resolve) => {
stage.toBlob({
@ -46,7 +48,7 @@ export const getRegionalPromptLayerBlobs = async (
if (preview) {
const base64 = await blobToDataURL(blob);
openBase64ImageInTab([{ base64, caption: layer.id() }]);
openBase64ImageInTab([{ base64, caption: `${reduxLayer.id}: ${reduxLayer.prompt}` }]);
}
layer.remove();
blobs[layer.id()] = blob;