Create Stunning Custom Images with Miaomiao Harem V1.5b

25 Apr 2025
Create Stunning Custom Images with Miaomiao Harem V1.5b

In today's digital landscape, the ability to generate high-quality images quickly and efficiently opens up new possibilities for developers and creatives alike. The Miaomiao Harem V1.5b Cognitive Action provides an advanced image generation service that lets you create custom images based on textual prompts. By leveraging specific parameters such as width, height, and CFG scale, developers can enhance the quality of generated images, making them suitable for a variety of applications—from game design to marketing materials.

Imagine being able to produce unique illustrations, character designs, or visual content for your applications without needing extensive artistic skills or resources. This capability allows for rapid prototyping and creative exploration, helping you bring your ideas to life faster than ever.

Prerequisites

To get started with the Miaomiao Harem V1.5b Cognitive Action, you'll need an API key for accessing the service and a basic understanding of how to make API calls.

Generate Custom Image Using MiaoMiao-Harem-v1.5b

The Generate Custom Image action allows you to create images by providing a detailed prompt along with various parameters that influence the generation process. This action addresses the need for customizable image creation, enabling users to tailor outputs to specific requirements or artistic visions.

Input Requirements

The input for this action consists of a JSON object that includes several fields:

  • seed (integer): The seed number for generating outputs; use -1 for a random seed.
  • model (string): Specifies the model to be used, which is "MiaoMiao-Harem-v1.5b".
  • steps (integer): Defines the number of steps for image generation, ranging from 1 to 100.
  • width (integer): The width of the generated image in pixels (1 to 4096).
  • height (integer): The height of the generated image in pixels (1 to 4096).
  • prompt (string): The textual prompt for image generation, utilizing Compel weighting syntax.
  • cfgScale (number): Controls the attention paid to the prompt (1 to 50).
  • clipSkip (integer): Number of CLIP layers to skip; 1 indicates no skip.
  • pagScale (number): Enhances results, compatible with CFG.
  • batchSize (integer): Number of images to generate simultaneously (1 to 4).
  • scheduler (string): The scheduling method for image generation.
  • prependPrompt (boolean): Option to prepend a pre-configured prompt for better output quality.
  • negativePrompt (string): Elements to exclude from the generated image.
  • guidanceRescale (number): Adjusts CFG-generated noise to mitigate overexposure.
  • faceDetectorYolov9c (boolean): Enables face detection.
  • handDetectorYolov9c (boolean): Enables hand detection.
  • variationalAutoEncoder (string): Specifies the VAE model for encoding and decoding tasks.
  • personDetectorYolov8mSeg (boolean): Enables person detection.

Example Input

{
  "seed": -1,
  "model": "MiaoMiao-Harem-v1.5b",
  "steps": 30,
  "width": 1024,
  "height": 1024,
  "prompt": "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V",
  "cfgScale": 6,
  "clipSkip": 2,
  "pagScale": 0,
  "batchSize": 1,
  "scheduler": "Euler a",
  "prependPrompt": true,
  "negativePrompt": "nsfw, naked",
  "guidanceRescale": 1,
  "faceDetectorYolov9c": true,
  "handDetectorYolov9c": false,
  "variationalAutoEncoder": "default",
  "personDetectorYolov8mSeg": false
}

Expected Output

The expected output is a link to the generated image, which could look something like this:

[
  "https://assets.cognitiveactions.com/invocations/059311df-2d83-4ff5-a5c7-b96d205f8d98/04d3e2f1-e198-4bd4-ab18-30ba0f2da600.png"
]

Use Cases for this Specific Action

  • Game Development: Create unique character designs or environments based on specific attributes, enhancing the visual storytelling of your game.
  • Marketing Campaigns: Generate tailored graphics for advertisements or social media posts that align perfectly with your campaign themes.
  • Artistic Exploration: Experiment with different prompts and parameters to discover new artistic styles or concepts without needing traditional artistic skills.
  • Content Creation: Quickly produce illustrations for blogs, articles, or other digital content, saving time and resources.
import requests
import json

# Replace with your actual Cognitive Actions API key and endpoint
# Ensure your environment securely handles the API key
COGNITIVE_ACTIONS_API_KEY = "YOUR_COGNITIVE_ACTIONS_API_KEY"
# This endpoint URL is hypothetical and should be documented for users
COGNITIVE_ACTIONS_EXECUTE_URL = "https://api.cognitiveactions.com/actions/execute"

action_id = "c6669310-5ea4-4d55-b1bb-a53d9ac8e5b3" # Action ID for: Generate Custom Image Using MiaoMiao-Harem-v1.5b

# Construct the exact input payload based on the action's requirements
# This example uses the predefined example_input for this action:
payload = {
  "seed": -1,
  "model": "MiaoMiao-Harem-v1.5b",
  "steps": 30,
  "width": 1024,
  "height": 1024,
  "prompt": "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V",
  "cfgScale": 6,
  "clipSkip": 2,
  "pagScale": 0,
  "batchSize": 1,
  "scheduler": "Euler a",
  "prependPrompt": true,
  "negativePrompt": "nsfw, naked",
  "guidanceRescale": 1,
  "faceDetectorYolov9c": true,
  "handDetectorYolov9c": false,
  "variationalAutoEncoder": "default",
  "personDetectorYolov8mSeg": false
}

headers = {
    "Authorization": f"Bearer {COGNITIVE_ACTIONS_API_KEY}",
    "Content-Type": "application/json",
    # Add any other required headers for the Cognitive Actions API
}

# Prepare the request body for the hypothetical execution endpoint
request_body = {
    "action_id": action_id,
    "inputs": payload
}

print(f"--- Calling Cognitive Action: {action.name or action_id} ---")
print(f"Endpoint: {COGNITIVE_ACTIONS_EXECUTE_URL}")
print(f"Action ID: {action_id}")
print("Payload being sent:")
print(json.dumps(request_body, indent=2))
print("------------------------------------------------")

try:
    response = requests.post(
        COGNITIVE_ACTIONS_EXECUTE_URL,
        headers=headers,
        json=request_body
    )
    response.raise_for_status() # Raise an exception for bad status codes (4xx or 5xx)

    result = response.json()
    print("Action executed successfully. Result:")
    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 (non-JSON): {e.response.text}")
    print("------------------------------------------------")

Conclusion

The Miaomiao Harem V1.5b Cognitive Action simplifies the process of generating custom images, offering developers the flexibility to create high-quality visuals tailored to their needs. With its rich set of parameters and straightforward input requirements, this action empowers you to explore creative possibilities efficiently. Whether you're developing a game, launching a marketing campaign, or simply experimenting with design, integrating this image generation capability can significantly enhance your projects. Start leveraging the power of AI-generated imagery today!