ntrolMethod").value;
      const fileElem = document.getElementById("imageInput");
      const promptVal = document.getElementById("prompt").value.trim();
      const resultBox = document.getElementById("resultBox");
      const styledImage = document.getElementById("styledImage");

      resultBox.textContent = "";
      resultBox.classList.remove("error");
      styledImage.style.display = "none";
      styledImage.src = "";

      if (!stabilityKey) {
        alert("Stability key is required.");
        