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/sdxl1.0-samaritan-3d"
# Request payload
data = {
"prompt": "3D cinematic film.(Bob Marley:2.0) 50 years old (caricature:0.2). bokeh, professional, 4k, highly detailed, drunk. tired. concert lights.",
"negative_prompt": "drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly. young. long neck. (cross eyed:1.5). multiple characters",
"samples": 1,
"scheduler": "Euler a",
"num_inference_steps": 25,
"guidance_scale": 7.5,
"seed": 4896513168,
"img_width": 896,
"img_height": 1152,
"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
Image width can be between 512 and 2048 in multiples of 8
Image height can be between 512 and 2048 in multiples of 8
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.
Samaritan 3D XL is an exceptional AI model designed to breathe life into the world of 3D cartoon characters. Based on the powerful SDXL framework, this model specializes in creating adorable cartoon characters, each brimming with a range of emotions. It's a perfect tool for animators, game developers, digital artists, and anyone passionate about bringing cartoon characters to life in a 3D space.
At its core, Samaritan 3D XL leverages the robust capabilities of the SDXL framework, ensuring high-quality, detailed 3D character renderings. This model is fine-tuned to capture the essence of cartoon characters, from their whimsical designs to their expressive emotions.
3D Cartoon Character Creation : Specializes in generating cute and expressive cartoon characters in 3D.
Emotional Range:Capable of depicting a wide variety of emotions, adding depth and personality to characters.
High-Quality Rendering: Produces detailed and visually appealing 3D characters, thanks to its SDXL base.
Creative Flexibility: Offers endless possibilities for character design and storytelling.
Animation and Film: Create unique and expressive characters for animated movies and series.
Video Game Development: Design engaging 3D characters for video games, enhancing player experience.
Digital Art: Combine photographic elements with artistic prompts for unique compositions.
Educational Content: Develop fun and engaging educational materials featuring cartoon characters.
Personal Projects: Bring your imaginative cartoon characters to life for personal enjoyment or online sharing.