Create Stunning Images with the GDP-Illustrious v1.1 Cognitive Actions

In the world of artificial intelligence and machine learning, image generation has become a fascinating field. The GDP-Illustrious v1.1 Cognitive Actions offer developers a powerful toolkit to create high-quality images with a wide range of customizable attributes. This blog post will guide you through the capabilities of the Generate Enhanced Image action, showcasing how to integrate it into your applications seamlessly.
Prerequisites
Before you start using the Cognitive Actions, ensure you have:
- An API key for the Cognitive Actions platform.
- The necessary setup to make HTTP requests (e.g., a Python environment with the
requestslibrary). - Basic understanding of JSON format and API integration.
Authentication typically involves passing your API key in the headers of your requests to ensure secure access to the Cognitive Actions.
Cognitive Actions Overview
Generate Enhanced Image
The Generate Enhanced Image action allows you to create high-quality images using the GDP-Illustrious-v1.1 model. This action supports various parameters, including width, height, prompts, and advanced features like face and hand detection through ADetailer models.
Input
The input for this action is structured as follows:
{
"seed": -1,
"model": "GDP-Illustrious-v1.1",
"steps": 30,
"width": 1024,
"height": 1024,
"prompt": "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V",
"clipSkip": 2,
"pagScale": 0,
"batchSize": 1,
"scheduler": "Euler a",
"configScale": 7,
"negativePrompt": "nsfw, naked",
"guidanceRescale": 1,
"prependPreprompt": true,
"variationalAutoencoder": "default"
}
- seed (integer): Specifies the seed value for generation. Use
-1for a random seed. - model (string): Specifies the model to utilize for generation; set to
"GDP-Illustrious-v1.1". - steps (integer): Defines the number of steps in the generation process, between
1and100. - width (integer): Defines the width of the generated image, between
1and4096pixels. - height (integer): Defines the height of the generated image, between
1and4096pixels. - prompt (string): The main prompt using Compel weighting syntax for image generation.
- clipSkip (integer): Skips a number of CLIP layers to optimize processing.
- pagScale (number): Adjusts the PAG scale to improve generation quality; set to
0to disable. - batchSize (integer): Specifies the number of images to generate in one batch (1-4).
- scheduler (string): Selects the scheduler method for the generation process from available options.
- configScale (number): Determines attention paid to the prompt in generation.
- negativePrompt (string): Specifies elements to exclude during generation.
- guidanceRescale (number): Adjusts the rescale level of CFG-generated noise.
- prependPreprompt (boolean): Determines if a standardized preprompt should be prepended.
- variationalAutoencoder (string): Selects the VAE model for enhancing image output.
Output
The action typically returns a URL to the generated image. For example:
[
"https://assets.cognitiveactions.com/invocations/e72fcfbe-0348-44f1-9e1d-5400a3dfdcdb/35773203-277c-4539-868e-0029254f7e8d.png"
]
Conceptual Usage Example (Python)
Here's a conceptual Python code snippet to illustrate how to call the Generate Enhanced Image action:
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 = "9b01de89-7f83-4f3e-a731-ac8a26afc323" # Action ID for Generate Enhanced Image
# Construct the input payload based on the action's requirements
payload = {
"seed": -1,
"model": "GDP-Illustrious-v1.1",
"steps": 30,
"width": 1024,
"height": 1024,
"prompt": "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V",
"clipSkip": 2,
"pagScale": 0,
"batchSize": 1,
"scheduler": "Euler a",
"configScale": 7,
"negativePrompt": "nsfw, naked",
"guidanceRescale": 1,
"prependPreprompt": True,
"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:
- Replace
YOUR_COGNITIVE_ACTIONS_API_KEYwith your actual API key. - The
action_idcorresponds to the Generate Enhanced Image action. - The
payloadis structured according to the input schema outlined above.
Conclusion
The Generate Enhanced Image action from the GDP-Illustrious v1.1 Cognitive Actions provides developers with an exceptional way to generate high-quality images tailored to specific requirements. With customizable attributes, this feature can be integrated into various applications, from game development to marketing materials.
Start experimenting with this action today, and unlock the potential of AI-driven image generation in your projects!