项目概述:disney-pixal-cartoon-a API
disney-pixal-cartoon-a API 是由ModelsLab推出的一个图像生成工具,它通过自然语言文本指令来生成超写实风格的图像。这个项目结合了稳定扩散技术,能够创建细节丰富且具备电影感的图像,主要适用于需要高质量卡通风格图像的用户,如创意工作者、设计师等。
如何获取API密钥
要使用disney-pixal-cartoon-a API,用户首先需要从ModelsLab网站获取一个API密钥。这个过程不涉及任何费用。获取密钥后,用户可以按照给定代码示例中指示的替换步骤进行操作,将model_id设置为"disney-pixal-cartoon-a"。
API调用示例
用户可以参考以下的Python示例代码,以便了解如何通过自然语言生成图像:
import requests
import json
url = "https://modelslab.com/api/v6/images/text2img"
payload = json.dumps({
"key": "your_api_key",
"model_id": "disney-pixal-cartoon-a",
"prompt": "ultra realistic close up portrait ((beautiful pale cyberpunk female with heavy black eyeliner)), blue eyes, shaved side haircut, hyper detail, cinematic lighting, magic neon, dark red city, Canon EOS R3, nikon, f/1.4, ISO 200, 1/160s, 8K, RAW, unedited, symmetrical balance, in-frame, 8K",
"negative_prompt": "painting, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, deformed, ugly, blurry, bad anatomy, bad proportions, extra limbs, cloned face, skinny, glitchy, double torso, extra arms, extra hands, mangled fingers, missing lips, ugly face, distorted face, extra legs, anime",
"width": "512",
"height": "512",
"samples": "1",
"num_inference_steps": "30",
"safety_checker": "no",
"enhance_prompt": "yes",
"seed": None,
"guidance_scale": 7.5,
"multi_lingual": "no",
"panorama": "no",
"self_attention": "no",
"upscale": "no",
"embeddings": "embeddings_model_id",
"lora": "lora_model_id",
"webhook": None,
"track_id": None
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
使用建议与优惠
ModelsLab 提供了详细的文档,以帮助用户更好地将API整合到他们的应用中。无论是PHP、Node.js还是Java等编程语言,用户都可以在指定的文档链接中找到相应的代码示例。此外,使用优惠码 DMGG0RBN 可以获得25%的折扣,进一步降低试用成本。
用户可以免费尝试该模型,并通过提供的链接生成图像,最大程度上体验这一工具所带来的创意生成效果。