Create Stunning Custom Images with Illustrious Sauce v1 Cognitive Actions

In the world of AI-driven creativity, generating custom images tailored to specific prompts has become increasingly accessible. The Illustrious Sauce v1 Cognitive Actions enable developers to create unique images based on user-defined parameters, making it a powerful tool for applications in gaming, art, and design. This blog post explores the capabilities of the "Generate Custom Images" action, detailing how to integrate it into your applications seamlessly.
Prerequisites
Before diving into the implementation, ensure you have the following:
- An API key for accessing the Cognitive Actions platform.
- A basic understanding of JSON and HTTP requests.
Authentication typically involves passing your API key in the request headers to verify your access to the Cognitive Actions services.
Cognitive Actions Overview
Generate Custom Images
The Generate Custom Images action is designed to create images based on a variety of user-defined parameters. It leverages the Illustrious-Sauce-v1 model to generate high-quality visuals that can be tailored to specific needs.
Category: Image Generation
Input
The action accepts a comprehensive set of parameters to customize the image generation process. Below is the schema along with an example input:
{
"seed": -1,
"model": "Illustrious-Sauce-v1",
"steps": 30,
"width": 1024,
"height": 1024,
"prompt": "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V",
"pagScale": 1,
"batchSize": 1,
"scheduler": "Euler a",
"clipLayerSkip": 2,
"negativePrompt": "nsfw, naked",
"useFaceYolov9c": true,
"useHandYolov9c": false,
"guidanceRescale": 1,
"prependPrePrompt": true,
"configurationScale": 5,
"usePersonYolov8mSeg": false,
"variationalAutoencoder": "default"
}
Input Fields:
seed(integer): Controls randomness; set to -1 for a random seed.model(string): Specifies the model; default is "Illustrious-Sauce-v1".steps(integer): Number of generation steps (1 to 100); default is 30.width(integer): Width of the image in pixels (1 to 4096); default is 1024.height(integer): Height of the image in pixels (1 to 4096); default is 1024.prompt(string): Descriptive text that guides the image generation.pagScale(number): Adjusts the Perceptual Attraction Gradient; default is 1.batchSize(integer): Number of images to generate (1 to 4); default is 1.scheduler(string): Algorithm used for generation; default is "Euler a".clipLayerSkip(integer): Number of CLIP layers to skip; default is 2.negativePrompt(string): Words to avoid in the image generation.- Additional boolean and number parameters control various aspects of the generation process.
Output
The action returns a URL to the generated image. Below is an example of the output you can expect:
[
"https://assets.cognitiveactions.com/invocations/8166074c-ffe2-45bc-886f-68036d8eacc4/68678b14-01d9-450f-9e6d-bfd115fb5d68.png"
]
Conceptual Usage Example (Python)
Here's how you can call the Generate Custom Images action using Python:
import requests
import json
# Replace with your Cognitive Actions API key and endpoint
COGNITIVE_ACTIONS_API_KEY = "YOUR_COGNITIVE_ACTIONS_API_KEY"
COGNITIVE_ACTIONS_EXECUTE_URL = "https://api.cognitiveactions.com/actions/execute" # Hypothetical endpoint
action_id = "90ff0a96-14e1-4ba6-b31a-221d7b651e82" # Action ID for Generate Custom Images
# Construct the input payload based on the action's requirements
payload = {
"seed": -1,
"model": "Illustrious-Sauce-v1",
"steps": 30,
"width": 1024,
"height": 1024,
"prompt": "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V",
"pagScale": 1,
"batchSize": 1,
"scheduler": "Euler a",
"clipLayerSkip": 2,
"negativePrompt": "nsfw, naked",
"useFaceYolov9c": True,
"useHandYolov9c": False,
"guidanceRescale": 1,
"prependPrePrompt": True,
"configurationScale": 5,
"usePersonYolov8mSeg": False,
"variationalAutoencoder": "default"
}
headers = {
"Authorization": f"Bearer {COGNITIVE_ACTIONS_API_KEY}",
"Content-Type": "application/json"
}
try:
response = requests.post(
COGNITIVE_ACTIONS_EXECUTE_URL,
headers=headers,
json={"action_id": action_id, "inputs": payload} # Hypothetical structure
)
response.raise_for_status() # Raise an exception for bad status codes (4xx or 5xx)
result = response.json()
print("Action executed successfully:")
print(json.dumps(result, indent=2))
except requests.exceptions.RequestException as e:
print(f"Error executing action {action_id}: {e}")
if e.response is not None:
print(f"Response status: {e.response.status_code}")
try:
print(f"Response body: {e.response.json()}")
except json.JSONDecodeError:
print(f"Response body: {e.response.text}")
In this code snippet, you'll need to replace the placeholder for COGNITIVE_ACTIONS_API_KEY with your actual API key. The payload is structured according to the requirements of the Generate Custom Images action, allowing for a tailored image generation request.
Conclusion
The Illustrious Sauce v1 Cognitive Action for generating custom images offers developers a powerful tool to create visuals catered to specific requirements. With a variety of configurable parameters, you can enhance your applications with stunning, unique images that captivate users. Consider exploring other potential use cases, such as integrating this functionality into artistic platforms or creating dynamic content for games. Happy coding!