fix: Preserve saved resolution

496b3570e6778d8b9e08b653b52098909f4e0d87

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +5 -1Showing whitespace changes
public/scripts/extensions/stable-diffusion/index.js+5 -1
@@ -5226,7 +5226,7 @@ async function generateMediaSwipe(mediaAttachment, message, onStart, onComplete,
52265226 const savedNegative = mediaAttachment.negative ?? message.extra.negative ?? '';
52275227 const refineArgs = {
52285228 negative: savedNegative,
52295229 resolution: mediaAttachment?.width && mediaAttachment?.height ? `${mediaAttachment.width}x${mediaAttachment.height}` : null,
52305230 };
52315231 const prompt = await refinePrompt(savedPrompt, refineArgs);
52325232 dimensions = setTypeSpecificDimensions(generationType, refineArgs.resolution ? mediaAttachment : null);
@@ -5241,6 +5241,10 @@ async function generateMediaSwipe(mediaAttachment, message, onStart, onComplete,
52415241 result.generation_type = generationType;
52425242 result.title = prompt;
52435243 result.negative = refineArgs.negative;
5244+ if (refineArgs.resolution) {
5245+ result.width = mediaAttachment.width;
5246+ result.height = mediaAttachment.height;
5247+ }
52445248 } finally {
52455249 onComplete();
52465250 $(stopButton).hide();