Generate Stunning Images with the Dark Sushi Mix 2.25D Cognitive Actions

In the rapidly evolving world of AI and image generation, the Dark Sushi Mix 2.25D Model offers developers a powerful toolset for creating captivating visuals. This model leverages advanced techniques for generating images through various modes such as Text2Img, Img2Img, and Inpainting. By utilizing pre-built Cognitive Actions, developers can enhance image generation quality with features like input prompts, guidance scales, and configurable inference steps, allowing for a diverse range of creative applications.
Prerequisites
Before diving into the integration of the Dark Sushi Mix Cognitive Actions, ensure you have the following:
- An API key to access the Cognitive Actions platform.
- Basic knowledge of JSON and RESTful API interactions.
- Familiarity with Python for implementing the conceptual example.
Authentication typically involves passing your API key in the request headers, which will authorize your access to the Cognitive Actions services.
Cognitive Actions Overview
Generate Images with Dark Sushi Mix Model
Description: This action allows you to utilize the Dark Sushi Mix 2.25D Model for image generation. With capabilities across Text2Img, Img2Img, and Inpainting, you can enhance the output quality by adjusting parameters like prompts and inference steps.
Category: Image Generation
Input
The input schema for this action is defined as follows:
{
"mask": "string (uri)",
"seed": "integer",
"image": "string (uri)",
"width": "integer",
"height": "integer",
"prompt": "string",
"strength": "number",
"scheduler": "string",
"guidanceScale": "number",
"negativePrompt": "string",
"numberOfOutputs": "integer",
"numberOfInferenceSteps": "integer"
}
Example Input:
{
"seed": 1026045682,
"width": 768,
"height": 1024,
"prompt": "masterpiece, best quality, 1girl, bag, upper body, street, bangs, bare shoulders, beret, black footwear, black headwear, brown eyes, brown hair, closed mouth, handbag, hat, holding, long hair, long sleeves, looking at viewer, off shoulder, shoes, skirt, sleeves past wrists, socks, solo, sweater, white legwear",
"strength": 0.8,
"scheduler": "Euler A Karras",
"guidanceScale": 7.5,
"negativePrompt": "disfigured, kitsch, ugly, oversaturated, greain, low-res, deformed, blurry, bad anatomy, poorly drawn face, mutation, mutated, extra limb, poorly drawn hands, missing limb, floating limbs, disconnected limbs, malformed hands, blur, out of focus, long neck, long body, disgusting, poorly drawn, childish, mutilated, mangled, old, surreal, calligraphy, sign, writing, watermark, text, body out of frame, extra legs, extra arms, extra feet, out of frame, poorly drawn feet, cross-eye",
"numberOfOutputs": 1,
"numberOfInferenceSteps": 50
}
Output
Upon successful execution, this action typically returns a list of generated image URLs.
Example Output:
[
"https://assets.cognitiveactions.com/invocations/09b05fa7-1fe4-4483-8c68-8722dd3af5cf/9e46d7b9-0a4d-40f8-8a35-be79da3823c6.png"
]
Conceptual Usage Example (Python)
Below is a conceptual Python code snippet demonstrating how to call the Cognitive Actions execution endpoint for generating images.
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 = "8922047e-bf1b-4fd2-a293-1330f731edd0" # Action ID for Generate Images with Dark Sushi Mix Model
# Construct the input payload based on the action's requirements
payload = {
"seed": 1026045682,
"width": 768,
"height": 1024,
"prompt": "masterpiece, best quality, 1girl, bag, upper body, street, bangs, bare shoulders, beret, black footwear, black headwear, brown eyes, brown hair, closed mouth, handbag, hat, holding, long hair, long sleeves, looking at viewer, off shoulder, shoes, skirt, sleeves past wrists, socks, solo, sweater, white legwear",
"strength": 0.8,
"scheduler": "Euler A Karras",
"guidanceScale": 7.5,
"negativePrompt": "disfigured, kitsch, ugly, oversaturated, greain, low-res, deformed, blurry, bad anatomy, poorly drawn face, mutation, mutated, extra limb, poorly drawn hands, missing limb, floating limbs, disconnected limbs, malformed hands, blur, out of focus, long neck, long body, disgusting, poorly drawn, childish, mutilated, mangled, old, surreal, calligraphy, sign, writing, watermark, text, body out of frame, extra legs, extra arms, extra feet, out of frame, poorly drawn feet, cross-eye",
"numberOfOutputs": 1,
"numberOfInferenceSteps": 50
}
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 Python snippet, replace the COGNITIVE_ACTIONS_API_KEY and the endpoint URL with your actual API key and endpoint. The action ID is set for the "Generate Images with Dark Sushi Mix Model," and the payload is constructed according to the required input schema. This example demonstrates how to send a POST request and handle the response appropriately.
Conclusion
The Dark Sushi Mix 2.25D Cognitive Actions provide a robust framework for developers looking to incorporate advanced image generation capabilities into their applications. By leveraging the power of the Dark Sushi Mix Model, you can create stunning visuals tailored to your specifications. Explore various use cases, from creative art generation to practical applications in design and marketing, and unlock new possibilities in your projects!