Skip to content

Commit

Permalink
Merge branch 'main' into new/feat/messages
Browse files Browse the repository at this point in the history
  • Loading branch information
techwithanirudh authored May 21, 2024
2 parents 443fd6a + f00a8f8 commit 7b3285b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions api/app/clients/tools/structured/StableDiffusion.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,18 @@ class StableDiffusionAPI extends StructuredTool {
const payload = {
prompt,
negative_prompt,
sampler_index: 'DPM++ 2M Karras',
cfg_scale: 4.5,
steps: 22,
width: 1024,
height: 1024,
};
const generationResponse = await axios.post(`${url}/sdapi/v1/txt2img`, payload);
let generationResponse;
try {
generationResponse = await axios.post(`${url}/sdapi/v1/txt2img`, payload);
} catch (error) {
logger.error('[StableDiffusion] Error while generating image:', error);
return 'Error making API request.';
}
const image = generationResponse.data.images[0];

/** @type {{ height: number, width: number, seed: number, infotexts: string[] }} */
Expand Down

0 comments on commit 7b3285b

Please sign in to comment.