Generate Stunning Images with SEMIMergeIJ Cognitive Actions

22 Apr 2025
Generate Stunning Images with SEMIMergeIJ Cognitive Actions

In the ever-evolving world of AI, image generation has made significant strides, allowing developers to create high-quality visuals with minimal effort. The SEMIMergeIJ-Illustrious-v3 Cognitive Actions offer powerful capabilities to generate customized images based on user-defined prompts and parameters. This blog post will explore how to leverage this action to tap into the potential of AI-driven image creation.

Prerequisites

Before you start using the SEMIMergeIJ Cognitive Action, ensure you have the following:

  • An API key for accessing the Cognitive Actions platform.
  • A basic understanding of JSON and how to structure API requests.

Authentication typically involves passing your API key in the headers of your requests, ensuring secure access to the service.

Cognitive Actions Overview

Generate Image with SEMIMergeIJ

Description: This action allows you to generate high-quality images using the SEMIMergeIJ-Illustrious-v3 model. You can customize various parameters such as image dimensions, prompts, and detail enhancement features for tailored output.

Category: Image Generation

Input

The following JSON schema outlines the required and optional fields for invoking the action:

{
  "vae": "NeptuniaXL-VAE-ContrastSaturation",
  "seed": -1,
  "model": "SEMIMergeIJ-Illustrious-v3",
  "steps": 30,
  "width": 1280,
  "height": 1280,
  "prompt": "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V",
  "upscale": "Original",
  "cfgScale": 1,
  "clipSkip": 2,
  "pagScale": 0,
  "batchSize": 1,
  "scheduler": "DPM++ 2M SDE Karras",
  "adetailerFace": false,
  "adetailerHand": false,
  "negativePrompt": "nsfw, naked",
  "adetailerPerson": false,
  "guidanceRescale": 1,
  "prependPreprompt": true
}
  • vae (optional): Specifies the Variational Autoencoder (VAE) to be used (default: "default").
  • seed (optional): An integer for random seed generation (-1 for random).
  • model (required): The model used for generation (default: "SEMIMergeIJ-Illustrious-v3").
  • steps (optional): Number of steps for generation (default: 30).
  • width (optional): Width of the generated image (default: 1080).
  • height (optional): Height of the generated image (default: 1080).
  • prompt (required): Text prompt guiding image generation.
  • upscale (optional): Scaling factor for the final image (default: "Original").
  • cfgScale (optional): Influences the prompt's effect on generation (default: 1).
  • clipSkip (optional): Number of CLIP layers to skip (default: 2).
  • pagScale (optional): Variant of CFG scale for enhancing results (default: 0).
  • batchSize (optional): Number of images to generate in a batch (default: 1).
  • scheduler (optional): Scheduler algorithm for the generation process (default: "Euler a").
  • adetailerFace (optional): Enables face detail enhancement (default: false).
  • adetailerHand (optional): Enables hand detail enhancement (default: false).
  • negativePrompt (optional): Elements to exclude from the image generation (default: "nsfw, naked").
  • adetailerPerson (optional): Enables person detail enhancement (default: false).
  • guidanceRescale (optional): Adjusts noise intensity (default: 1).
  • prependPreprompt (optional): Adds a preprompt to the existing prompt (default: true).

Example Input

Here’s an example input payload for the action:

{
  "vae": "NeptuniaXL-VAE-ContrastSaturation",
  "seed": -1,
  "model": "SEMIMergeIJ-Illustrious-v3",
  "steps": 30,
  "width": 1280,
  "height": 1280,
  "prompt": "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V",
  "upscale": "Original",
  "cfgScale": 1,
  "clipSkip": 2,
  "pagScale": 0,
  "batchSize": 1,
  "scheduler": "DPM++ 2M SDE Karras",
  "adetailerFace": false,
  "adetailerHand": false,
  "negativePrompt": "nsfw, naked",
  "adetailerPerson": false,
  "guidanceRescale": 1,
  "prependPreprompt": true
}

Output

The action typically returns a URL to the generated image. For example:

[
  "https://assets.cognitiveactions.com/invocations/d315d37f-798e-4426-bac2-0929cc559e7c/653c58d1-07a3-4f5e-9904-aeee6326ed39.png"
]

Conceptual Usage Example (Python)

Below is a conceptual Python code snippet demonstrating how to call the SEMIMergeIJ 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 = "2c3833f6-5b07-4310-879a-b457eecb8042" # Action ID for Generate Image with SEMIMergeIJ

# Construct the input payload based on the action's requirements
payload = {
    "vae": "NeptuniaXL-VAE-ContrastSaturation",
    "seed": -1,
    "model": "SEMIMergeIJ-Illustrious-v3",
    "steps": 30,
    "width": 1280,
    "height": 1280,
    "prompt": "street, 1girl, dark-purple short hair, purple eyes, medium breasts, cleavage, casual clothes, smile, V",
    "upscale": "Original",
    "cfgScale": 1,
    "clipSkip": 2,
    "pagScale": 0,
    "batchSize": 1,
    "scheduler": "DPM++ 2M SDE Karras",
    "adetailerFace": False,
    "adetailerHand": False,
    "negativePrompt": "nsfw, naked",
    "adetailerPerson": False,
    "guidanceRescale": 1,
    "prependPreprompt": True
}

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, the API key and endpoint URL should be replaced with actual values. The action ID for "Generate Image with SEMIMergeIJ" is specified, and the input payload is constructed based on the action's requirements.

Conclusion

The SEMIMergeIJ Cognitive Actions provide an exciting opportunity for developers to create stunning, customized images effortlessly. By utilizing the various configurable parameters, you can fine-tune the output to meet specific needs and preferences. Whether you're working on a creative project, a game, or an application, these actions can significantly enhance your visual content generation capabilities. Start exploring and integrating the SEMIMergeIJ actions into your applications today!