      if (method === 'sketch') {
          rawResult = await stability.controlSketch({
            imagePath: fileElem.files[0],
            prompt: promptVal,
            output_format: 'png',
            accept: 'image/*'
          });
        } else if (method === 'structure') {
          rawResult = await stability.controlStructure({
            imagePath: fileElem.files[0],
            prompt: promptVal,
            output_format: 'png',
            accept: 'image/*'
          });
        } else {
    