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
35
36
import requests
import base64
# Use this function to convert an image file from the filesystem to base64
def image_file_to_base64(image_path):
with open(image_path, 'rb') as f:
image_data = f.read()
return base64.b64encode(image_data).decode('utf-8')
# Use this function to fetch an image from a URL and convert it to base64
def image_url_to_base64(image_url):
response = requests.get(image_url)
image_data = response.content
return base64.b64encode(image_data).decode('utf-8')
api_key = "YOUR_API_KEY"
url = "https://api.segmind.com/v1/segmind-vega"
# Request payload
data = {
"prompt": "cinematic photo detailed closeup portraid of a Beautiful cyberpunk woman, robotic parts, cables, lights, text; , high quality photography, 3 point lighting, flash with softbox, 4k, Canon EOS R3, hdr, smooth, sharp focus, high resolution, award winning photo, 80mm, f2.8, bokeh . 35mm photograph, film, bokeh, professional, 4k, highly detailed, high quality photography, 3 point lighting, flash with softbox, 4k, Canon EOS R3, hdr, smooth, sharp focus, high resolution, award winning photo, 80mm, f2.8, bokeh",
"negative_prompt": "(worst quality, low quality)",
"samples": 1,
"scheduler": "UniPC",
"num_inference_steps": 25,
"guidance_scale": 9,
"seed": 1232788698,
"img_width": 1024,
"img_height": 1024,
"base64": False
}
headers = {'x-api-key': api_key}
response = requests.post(url, json=data, headers=headers)
print(response.content) # The response is the generated image
Prompt to render
Prompts to exclude, eg. 'bad anatomy, bad hands, missing fingers'
Number of samples to generate.
min : 1,
max : 4
Type of scheduler.
Allowed values:
Number of denoising steps.
min : 20,
max : 100
Scale for classifier-free guidance
min : 1,
max : 25
Seed for image generation.
min : -1,
max : 999999999999999
Can only be 1024 for SDXL
Allowed values:
Can only be 1024 for SDXL
Allowed values:
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.
Born from the distillation of the renowned Stable Diffusion XL (SDXL), it boasts an unparalleled combination of speed and quality. With a 70% reduction in size and a staggering 100% increase in processing speed, Segmind-Vega emerges as a game-changer in the field. Its training, enriched by diverse datasets such as Grit and Midjourney scrape data, ensures a remarkable versatility in interpreting and visualizing a wide array of textual prompts.
What truly sets the Segmind-Vega Model apart is its sophisticated knowledge distillation approach. By integrating the wisdom of several expert models, including SDXL, ZavyChromaXL, and JuggernautXL, Segmind-Vega synthesizes their strengths while skillfully circumventing their limitations. This synthesis results in a model that not only excels at generating high-quality images but does so with remarkable speed and efficiency. It's a testament to the power of collaborative learning in AI, where the collective knowledge of multiple models is harnessed to achieve a singular, exceptional capability in image generation.
The applications of the Segmind-Vega Model are as diverse as its training datasets. In the world of art and design, it serves as a digital muse, offering artists and designers a plethora of visual possibilities to inspire and enhance their creative processes. Educational sectors benefit immensely, as the model can generate illustrative content to aid in teaching and learning, making complex concepts visually accessible and engaging. For researchers, Segmind-Vega is a valuable tool to explore the frontiers of generative models, analyze biases and limitations, and contribute to the broader understanding of AI behavior. Above all, the model's commitment to safe content generation ensures that it paves the way for responsible and ethical use of AI in creative domains.