Generate Stunning Images with MiaoMiao-Harem-v1.5a Cognitive Actions

In the world of artificial intelligence, image generation has become a fascinating frontier. The MiaoMiao-Harem-v1.5a Cognitive Actions allow developers to create high-quality images based on specific parameters such as seed, resolution, and descriptive prompts. These pre-built actions streamline the process of integrating image generation capabilities into applications, enabling developers to focus on creativity and functionality without needing to build complex models from scratch.
Prerequisites
Before you can start using the MiaoMiao-Harem-v1.5a Cognitive Actions, ensure you have the following:
- API Key: You'll need an API key to authenticate your requests. This key should be included in the headers of your API calls.
- Endpoint Setup: Familiarize yourself with the endpoint structure for executing actions, which will be outlined in the usage examples.
Cognitive Actions Overview
Generate Image Using MiaoMiao-Harem-v1.5a
The Generate Image Using MiaoMiao-Harem-v1.5a action allows you to generate high-quality images by specifying various parameters. It supports customizable settings to fine-tune the output, including the model version, image dimensions, and more.
Input
The action requires a structured JSON input consisting of the following fields:
- seed (integer): The seed value used for generation. Set to -1 for a random seed.
- model (string): Specifies the model to be used for generation. Default is "MiaoMiao-Harem-v1.5a".
- steps (integer): The number of steps in the generation process (1-100).
- width (integer): Width of the generated image (1-4096 pixels).
- height (integer): Height of the generated image (1-4096 pixels).
- prompt (string): Descriptive text guiding the generation process.
- batchSize (integer): Number of images to generate (1-4).
- scheduler (string): Scheduler to use during generation, default is "Euler a".
- clipLayerSkip (integer): Number of CLIP layers to skip (minimum 1).
- negativePrompt (string): Elements to avoid in the generated image.
- prependPreprompt (boolean): Whether to prepend a preprompt (defaults to true).
- configurationScale (number): CFG scale adjusting adherence to the prompt (1-50).
- guidanceNoiseRescale (number): Rescaling of CFG-generated noise to manage exposure (0-5).
- visualAttentionEncoder (string): Visual Attention Encoder choice (default is "default").
- progressiveAttentionGuideScale (number): Sets the Progressive Attention Guide scale (0-50).
Here’s an example input that demonstrates the structure:
{
"seed": -1,
"model": "MiaoMiao-Harem-v1.5a",
"steps": 30,
"width": 1024,
"height": 1024,
"prompt": "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V",
"batchSize": 1,
"scheduler": "Euler a",
"clipLayerSkip": 2,
"negativePrompt": "nsfw, naked",
"prependPreprompt": true,
"configurationScale": 6,
"guidanceNoiseRescale": 1,
"visualAttentionEncoder": "default",
"progressiveAttentionGuideScale": 0
}
Output
Upon successful execution, you'll receive a response containing URLs to the generated images. Here’s an example output:
[
"https://assets.cognitiveactions.com/invocations/6c9a38b8-9a07-4feb-8f87-cd619cd711d1/00cd1ce0-a71e-4efd-b008-1a83f0dd0c60.png"
]
Conceptual Usage Example (Python)
Below is a conceptual Python code snippet demonstrating how a developer might invoke the Generate Image Using MiaoMiao-Harem-v1.5a 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 = "6486d7e9-1401-4d8f-b328-001b878e5091" # Action ID for Generate Image Using MiaoMiao-Harem-v1.5a
# Construct the input payload based on the action's requirements
payload = {
"seed": -1,
"model": "MiaoMiao-Harem-v1.5a",
"steps": 30,
"width": 1024,
"height": 1024,
"prompt": "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V",
"batchSize": 1,
"scheduler": "Euler a",
"clipLayerSkip": 2,
"negativePrompt": "nsfw, naked",
"prependPreprompt": True,
"configurationScale": 6,
"guidanceNoiseRescale": 1,
"visualAttentionEncoder": "default",
"progressiveAttentionGuideScale": 0
}
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 example, replace YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key. The action ID corresponds to Generate Image Using MiaoMiao-Harem-v1.5a, and the input payload is structured to match the action's requirements.
Conclusion
The MiaoMiao-Harem-v1.5a Cognitive Actions provide a powerful and flexible way to generate images tailored to your specifications. By leveraging this action, developers can easily integrate advanced image generation capabilities into their applications, enhancing user experiences and creative possibilities. Explore further use cases or combine this action with other cognitive features to unlock new dimensions in your projects!