Create Stunning Custom Images with Irtv Mosque Actions

25 Apr 2025
Create Stunning Custom Images with Irtv Mosque Actions

In the world of digital content creation, the ability to generate high-quality images quickly and efficiently is invaluable. The Irtv Mosque service offers a powerful Cognitive Action that allows developers to generate custom images using advanced inpainting techniques. This capability not only simplifies the image creation process but also enhances the creative potential, enabling users to specify dimensions, aspect ratios, and various other parameters tailored to their needs.

Imagine creating breathtaking visuals for your applications, marketing materials, or social media posts without the need for extensive design skills or resources. With Irtv Mosque, you can transform descriptive prompts into stunning visuals, making it an ideal solution for artists, marketers, game developers, and anyone in need of custom imagery.

Prerequisites

Before diving into the capabilities of Irtv Mosque, you'll need an API key for the Cognitive Actions service and a basic understanding of how to make API calls.

Generate Custom Image

The "Generate Custom Image" action is designed to create unique images based on user-defined specifications. This action utilizes advanced inpainting techniques to generate images that meet specific requirements, solving the problem of creating custom visuals from scratch.

Input Requirements

To use this action effectively, you will need to provide the following inputs:

  • prompt: A detailed description of the desired image (required).
  • mask: An optional URI for an image mask used in inpainting mode.
  • image: An optional URI of an input image for image-to-image generation.
  • model: Choose between "dev" or "schnell" for inference.
  • width/height: Specify dimensions for the image (optional).
  • goFast: A toggle for faster predictions.
  • imageFormat: Select the desired output format (webp, jpg, png).
  • outputCount: The number of images to generate (max 4).
  • outputQuality: Sets the quality of the saved images.
  • safetyChecker: Option to enable or disable safety checks.
  • Additional parameters like denoisingSteps, aspect ratio, and intensities for more control over the output.

Expected Output

The action will return a set of images in the specified format, each generated based on your input prompt and parameters. You can expect links to the generated images, showcasing the results of your specifications.

Use Cases for this specific action

  • Marketing Campaigns: Quickly generate eye-catching visuals for advertisements or social media posts.
  • Content Creation: Create unique images for blogs, articles, and websites that align with specific themes or topics.
  • Game Development: Produce custom artwork for game assets, character designs, or environment backgrounds.
  • Artistic Projects: Enable artists to visualize concepts and ideas through generated imagery based on descriptive prompts.
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 = "7e1cb8d2-d7a5-4bd4-ba2a-07966c8b1d22" # Action ID for: Generate Custom Image

# Construct the exact input payload based on the action's requirements
# This example uses the predefined example_input for this action:
payload = {
  "model": "dev",
  "goFast": false,
  "prompt": "A breathtaking aerial view of Vladikavkaz, Russia, featuring the historic Mukhtarov Mosque as the focal point. The mosque, with its distinctive twin minarets and intricate Oriental-style detailing, stands gracefully among the city's architectural blend of old and modern buildings. The Terek River winds through the city, reflecting the golden sunlight and flanked by lush, tree-lined streets.\n\nIn the background, the majestic Ossetian mountains rise, their rugged peaks standing tall against a brilliant blue sky. Soft clouds hover near the summits, adding depth to the composition. The city's streets bustle with activity, with visible parks, bridges, and classic European-style facades complementing the modern urban structures.\n\nAbove the city, several aerostats float gently in the distance, their soft, rounded forms contrasting with the rigid geometry of the mosque and cityscape. The sunlight casts a warm glow over the entire scene, enhancing the rich colors of the buildings and natural elements. The atmosphere is serene yet dynamic, capturing the harmony between Vladikavkaz's historical heritage and its evolving modernity",
  "imageFormat": "png",
  "outputCount": 4,
  "outputQuality": 80,
  "denoisingSteps": 28,
  "imageResolution": "1",
  "promptIntensity": 0.8,
  "imageAspectRatio": "21:9",
  "guidanceIntensity": 3,
  "mainLoraIntensity": 1,
  "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 Irtv Mosque's Generate Custom Image action empowers developers and creators to produce high-quality, custom images that meet their specific needs quickly and easily. Whether you're working in marketing, game development, or content creation, this action can streamline your workflow and enhance your creative projects.

To get started, integrate the Irtv Mosque Cognitive Actions into your applications and explore the endless possibilities of image generation tailored to your unique vision.