return;
      }
      if (!fileElem.files[0]) {
        alert("Upload an image first.");
        return;
      }
      if (!validImage) {
        alert("The selected image doesn't meet dimension constraints.");
        return;
      }
      if (!promptVal) {
        alert("Enter a prompt for the control method.");
        return;
      }

      try {
        resultBox.textContent = `Applying ${method}...`;
        const stability = new IntelliNode.StabilityAIWrapper(stabilityKey);

        let rawResult;
  