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,
5226 const savedNegative = mediaAttachment.negative ?? message.extra.negative ?? '';5226 const savedNegative = mediaAttachment.negative ?? message.extra.negative ?? '';
5227 const refineArgs = {5227 const refineArgs = {
5228 negative: savedNegative,5228 negative: savedNegative,
5229 resolution: mediaAttachment?.width && mediaAttachment?.height ? `${mediaAttachment.width}x${mediaAttachment.height}` : null,5229 resolution: mediaAttachment.width && mediaAttachment.height ? `${mediaAttachment.width}x${mediaAttachment.height}` : null,
5230 };5230 };
5231 const prompt = await refinePrompt(savedPrompt, refineArgs);5231 const prompt = await refinePrompt(savedPrompt, refineArgs);
5232 dimensions = setTypeSpecificDimensions(generationType, refineArgs.resolution ? mediaAttachment : null);5232 dimensions = setTypeSpecificDimensions(generationType, refineArgs.resolution ? mediaAttachment : null);
@@ -5241,6 +5241,10 @@ async function generateMediaSwipe(mediaAttachment, message, onStart, onComplete,
5241 result.generation_type = generationType;5241 result.generation_type = generationType;
5242 result.title = prompt;5242 result.title = prompt;
5243 result.negative = refineArgs.negative;5243 result.negative = refineArgs.negative;
5244 if (refineArgs.resolution) {
5245 result.width = mediaAttachment.width;
5246 result.height = mediaAttachment.height;
5247 }
5244 } finally {5248 } finally {
5245 onComplete();5249 onComplete();
5246 $(stopButton).hide();5250 $(stopButton).hide();