Generate Stunning Images with the adirik/realistic-vision-v6.0 Cognitive Action

22 Apr 2025
Generate Stunning Images with the adirik/realistic-vision-v6.0 Cognitive Action

The adirik/realistic-vision-v6.0 API provides developers with a powerful tool for generating photorealistic images. Leveraging the advanced capabilities of a fine-tuned Stable Diffusion v1.5 model, this API allows you to create high-quality images based on detailed prompts. With customizable parameters such as image dimensions, scheduling options, and guidance scales, developers can enhance their applications with dynamic visual content. In this article, we will explore the capabilities of the Generate Photorealistic Images with Realistic Vision v6.0 action and how to effectively integrate it into your applications.

Prerequisites

Before you start integrating the Cognitive Actions, ensure you have the following:

  • An API key for the Cognitive Actions platform to authenticate your requests.
  • Basic knowledge of sending HTTP requests and handling JSON data in your application.

Authentication is typically handled by including your API key in the request headers. This allows the system to verify your identity and permissions when calling the Cognitive Actions.

Cognitive Actions Overview

Generate Photorealistic Images with Realistic Vision v6.0

This action enables you to create stunning and lifelike images using a detailed text prompt. You can customize the results by specifying various parameters, which significantly enhances the quality and relevance of the generated images.

Input

The input for this action is structured as follows:

{
  "seed": 12345,
  "width": 512,
  "height": 728,
  "prompt": "A man walking his dog on the beach",
  "scheduler": "DPM++_SDE_Karras",
  "guidanceScale": 2,
  "numberOfSteps": 20,
  "negativePrompt": "(deformed iris, deformed pupils, semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime), text, cropped, out of frame, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck",
  "numberOfOutputs": 1
}
  • seed (integer, optional): Random seed for reproducibility. If omitted, a random seed will be used.
  • width (integer, required): The width of the output image (default: 512, max: 1920).
  • height (integer, required): The height of the output image (default: 728, max: 1920).
  • prompt (string, required): The main description for the image (default: "RAW photo, a portrait photo of a latina woman in casual clothes...").
  • scheduler (string, optional): Scheduler type for the diffusion process (default: "DPM++_SDE_Karras").
  • guidanceScale (number, optional): Scale for classifier-free guidance (default: 2, range: 1-50).
  • numberOfSteps (integer, optional): Number of diffusion steps (default: 20, range: 0-100).
  • negativePrompt (string, optional): Keywords to avoid in the generated image.
  • numberOfOutputs (integer, optional): How many images to generate (default: 1, range: 1-4).

Output

The output from this action is an array of URLs linking to the generated images. For example:

[
  "https://assets.cognitiveactions.com/invocations/ecfb983f-3bde-41fd-a70e-099187315b50/8c2e1118-a390-49eb-af78-877fde844ca1.png"
]

If the request is successful, you will receive one or more URLs pointing to the generated images, allowing you to easily display or download them in your application.

Conceptual Usage Example (Python)

Here's a conceptual example of how you would call the Generate Photorealistic Images with Realistic Vision v6.0 action using Python:

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 = "4b50f4ed-86b8-4108-b015-de63eda3dcba"  # Action ID for Generate Photorealistic Images

# Construct the input payload based on the action's requirements
payload = {
    "width": 512,
    "height": 728,
    "prompt": "A man walking his dog on the beach",
    "scheduler": "DPM++_SDE_Karras",
    "guidanceScale": 2,
    "numberOfSteps": 20,
    "negativePrompt": "(deformed iris, deformed pupils, semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime), text, cropped, out of frame, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck",
    "numberOfOutputs": 1
}

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 the COGNITIVE_ACTIONS_API_KEY and endpoint with your actual values.
  • The payload is structured according to the input schema described earlier.
  • The action ID is specified to indicate which action you want to execute.
  • The response is processed to retrieve and display the generated image URLs.

Conclusion

The adirik/realistic-vision-v6.0 Cognitive Action provides developers with an exciting opportunity to integrate high-quality image generation into their applications effortlessly. By leveraging the power of this API, you can create captivating visuals that enhance user engagement. Explore different prompts and parameters to see what creative outputs you can achieve, and start building applications that stand out with stunning imagery today!