Create Stunning Images from Text Prompts with Cult Contemplazione

26 Apr 2025
Create Stunning Images from Text Prompts with Cult Contemplazione

In the world of digital content creation, visuals play a pivotal role in capturing attention and conveying messages effectively. Cult Contemplazione offers an innovative set of Cognitive Actions designed to generate high-quality images from detailed text prompts. This service simplifies the image creation process, allowing developers to harness the power of AI to produce stunning visuals quickly and efficiently. Whether you're building an application that requires dynamic visual content, creating marketing materials, or developing artistic projects, this capability can save you time and enhance your creative output.

Imagine being able to describe a scene in words and instantly receive a corresponding image. This service is particularly beneficial for industries such as gaming, advertising, and education, where compelling visuals are essential. By integrating Cult Contemplazione into your projects, you can automate the image generation process, allowing for rapid iterations and creative exploration without the need for extensive graphic design skills.

Prerequisites

To get started, you'll need a Cognitive Actions API key and a basic understanding of making API calls.

Generate Image from Prompt

Cult Contemplazione's "Generate Image from Prompt" action allows users to create images based on a specified text prompt. This operation is versatile, supporting both standard image generation and inpainting modes, making it suitable for a variety of creative tasks.

Purpose

The primary purpose of this action is to turn descriptive text into visual representations, addressing the need for quick and efficient image creation. It leverages advanced models to ensure high-quality outputs that can be tailored to specific requirements.

Input Requirements

The action requires a JSON object as input, with the following essential properties:

  • prompt: A detailed description of the desired image (required).
  • model: Choose between "dev" for quality or "schnell" for speed (optional).
  • imageQuality: An integer value between 0 and 100 to specify output quality (optional).
  • imageAspectRatio: Determines the dimensions of the generated image (optional).
  • Additional parameters like seed, numberOfOutputs, and inferenceStepsCount can further customize the output.

Expected Output

The output will be a URL link to the generated image in your specified format (e.g., webp, jpg, png). The image will reflect the characteristics described in the prompt, capturing the essence of the input text.

Use Cases for this specific action

  • Marketing Materials: Quickly generate relevant visuals for promotional content based on campaign themes.
  • Art and Design: Artists can use this tool to brainstorm and visualize concepts from textual ideas.
  • Gaming: Game developers can create assets based on narrative descriptions, speeding up the design process.
  • Education: Educators can illustrate complex concepts or stories using generated images, enhancing learning materials.
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 = "043b8507-f46b-48f8-862d-60b4c109beff" # Action ID for: Generate Image from Prompt

# Construct the exact input payload based on the action's requirements
# This example uses the predefined example_input for this action:
payload = {
  "model": "dev",
  "prompt": "\"A raw, grainy 35mm film photograph, captured in near-total darkness—only a single, violent burst of flash reveals fragmented details, carving stark highlights into the void. The image, taken in secrecy, feels stolen, intrusive, imperfect—an unfiltered glimpse into something that was never meant to be seen. The oppressive darkness swallows everything beyond the immediate flash’s reach, making the moment feel isolated, disorienting, as if suspended in an abyss.\n\nTwo figures, cloaked in heavy, white robes adorned with cryptic, minimal embroidery, are caught in the frame, their forms barely materializing from the shadows. The flash scorches their fabric with overexposed highlights, while the deep grain and multiple exposure distortions cause their bodies to flicker in and out of focus—a ghostly, mechanical movement frozen mid-action.\n\nOne figure is in the process of forcefully placing a rigid, brutalist metal mask onto the other. The mask has a geometric, industrial design, tapering down into a sharp form with two large, circular eye holes that stare blankly. Its hard, metallic surface reflects the harsh flash, creating unnatural, jagged highlights that contrast sharply against the surrounding darkness. The figure receiving the mask remains tense, their hands twitching slightly, their form slightly distorted by the multi-exposure, giving the impression that they are flickering between submission and resistance.\n\nThe environment is raw, industrial, and brutalist—an empty, lifeless concrete space, its edges barely visible beyond the reach of the flash. There is no context, no escape—just an act frozen in time. The only details that emerge from the void are the stark textures of fabric, steel, and cold hands gripping the mask.\n\nThe imperfections of the film—harsh contrast, deep grain, erratic multi-exposure blur, and the aggressive flash—turn the image into something unsettling, documentary-like, yet unreal. It feels like an unrepeatable, haunted moment, a silent initiation or an act of transformation caught in secrecy. An industrial ritual, a brutalist offering, a ceremony where faith and machinery collide in the absolute void. use tokcontemplazione3",
  "speedMode": false,
  "megapixels": "1",
  "imageQuality": 100,
  "resultFormat": "webp",
  "loraIntensity": 1,
  "numberOfOutputs": 1,
  "promptIntensity": 0.8,
  "imageAspectRatio": "16:9",
  "guidanceIntensity": 3,
  "inferenceStepsCount": 28,
  "additionalLoraIntensity": 1
}

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 "Generate Image from Prompt" action from Cult Contemplazione provides developers with a powerful tool for creating engaging visuals from text descriptions. Its versatility and efficiency can significantly enhance content creation processes across various industries. By leveraging this capability, you can streamline your workflow, foster creativity, and produce high-quality images that resonate with your audience. As a next step, consider integrating this action into your applications to explore the limitless possibilities of AI-driven image generation.