POST
javascript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 const axios = require('axios'); const fs = require('fs'); const path = require('path'); async function toB64(imgPath) { const data = fs.readFileSync(path.resolve(imgPath)); return Buffer.from(data).toString('base64'); } const api_key = "YOUR API-KEY"; const url = "https://api.segmind.com/v1/ssd-canny"; const data = { "image": "toB64('https://segmind-sd-models.s3.amazonaws.com/outputs/ssd_canny_input.png')", "prompt": "beautiful lady, scandanavian, natural skin, big smile, black hair, dark makeup, wearing a black top, hyperdetailed photography, sharp focus on face, soft light, dark background, head and shoulders portrait, cover, city bokeh background", "negative_prompt": "low quality, ugly, painting", "samples": 1, "scheduler": "UniPC", "num_inference_steps": 30, "guidance_scale": 7.5, "seed": 760941192, "controlnet_scale": 0.5, "base64": false }; (async function() { try { const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } }); console.log(response.data); } catch (error) { console.error('Error:', error.response.data); } })();
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


imageimage *

Input Image


promptstr *

Prompt to render


negative_promptstr ( default: None )

Prompts to exclude, eg. 'bad anatomy, bad hands, missing fingers'


samplesint ( default: 1 ) Affects Pricing

Number of samples to generate.

min : 1,

max : 4


schedulerenum:str ( default: DPM2 Karras )

Type of scheduler.

Allowed values:


num_inference_stepsint ( default: 30 ) Affects Pricing

Number of denoising steps.

min : 10,

max : 100


guidance_scalefloat ( default: 7.5 )

Scale for classifier-free guidance

min : 1,

max : 25


seedint ( default: -1 )

Seed for image generation.

min : -1,

max : 999999999999999


controlnet_scalefloat ( default: 7.5 )

Scale for classifier-free guidance

min : 0,

max : 1


base64boolean ( default: 1 )

Base64 encoding of the output image.

To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.

Segmind Stable Diffusion 1B (SSD-1B) Canny

The Segmind Stable Diffusion 1B (SSD-1B) Canny Model empowers users to transform images with an unprecedented level of control over edge detection parameters, allowing for the meticulous accentuation and definition of edges within any image.

The SSD-1B Canny model is built upon the solid foundation of canny edge detection, renowned for its precision in highlighting the contours within images. This transformative model is engineered to fine-tune edge detection, offering users the flexibility to adjust parameters to their exact specifications. Whether aiming for subtle texture enhancements or dramatic edge definitions, the SSD-1B Canny model stands ready to deliver.

Advantages

  1. Accurate Edge Detection: Harnesses the renowned canny edge detection for precise edge delineation.

  2. Customizable Control: Provides users with extensive control to customize edge detection to their preferences.

  3. Adaptable Use Cases: Versatile across various applications, from artistic endeavors to technical image analysis.

  4. Immediate Results: Delivers real-time manipulation, offering instant feedback and swift results.

  5. Seamless Integration: Crafted for easy incorporation into diverse platforms, enhancing both image editing solutions and computer vision systems.

Use Cases

  1. Enhanced Image Segmentation: Essential for tasks requiring exact edge detection, ensuring sharp and accurate segmentation..

  2. Focused Image Enhancement: Enables users to bring particular edges into the spotlight, improving image clarity and emphasis.

  3. Creative Visual Effects: Provides artists with the capability to craft striking visual effects through edge manipulation.

  4. Advanced Editing Features: Can be integrated into image editing software, granting advanced edge refinement tools to users..