Create Stunning Custom Images with Atul Goa

25 Apr 2025
Create Stunning Custom Images with Atul Goa

In the ever-evolving landscape of digital content creation, the ability to generate high-quality images tailored to specific requirements is invaluable. Atul Goa offers a robust set of Cognitive Actions designed to empower developers with the tools needed to create custom images effortlessly. By harnessing the capabilities of AI-driven image generation, you can simplify workflows, enhance creativity, and achieve remarkable results in record time.

Imagine a scenario where you need a series of images for a marketing campaign, each requiring unique specifications. With Atul Goa's image generation capabilities, you can quickly generate images that align perfectly with your vision, whether you're looking for an image-to-image transformation or inpainting.

Prerequisites

To get started with Atul Goa, you'll need a Cognitive Actions API key and a basic understanding of making API calls. This will allow you to integrate the image generation functionalities seamlessly into your applications.

Generate Image with Custom Parameters

The Generate Image with Custom Parameters action is designed for users who want to create custom images based on specific prompts and adjustable parameters. This action solves the problem of needing tailored visual content, whether for personal projects, marketing materials, or creative endeavors.

Input Requirements

The action requires the following inputs:

  • prompt (string): A descriptive text prompt to guide the image generation process.
  • mask (string, optional): URI of the image mask for inpainting mode.
  • seed (integer, optional): Seed value for reproducible image generation.
  • image (string, optional): URI of the input image for transformations.
  • width (integer, optional): Width of the generated image (only for custom aspect ratios).
  • height (integer, optional): Height of the generated image (only for custom aspect ratios).
  • aspectRatio (string): Defines the aspect ratio (supports various formats).
  • goFast (boolean): Optimize for faster predictions.
  • numOutputs (integer): Number of images to generate (1-4).
  • outputFormat (string): Specifies the file format for the output image.
  • guidanceScale (number): A control parameter for the generation process.
  • outputQuality (integer): Quality level of the output image.
  • numInferenceSteps (integer): Number of denoising steps to enhance image detail.

Expected Output

The action outputs a URL link to the generated image, providing easy access to the finished product.

Use Cases for this specific action:

  • Marketing Campaigns: Quickly generate images that fit specific themes or styles for promotional materials.
  • Personal Projects: Create unique images based on personal prompts or requirements for social media, blogs, or portfolios.
  • Creative Exploration: Experiment with different parameters to generate artwork or visual content that pushes creative boundaries.
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 = "c241dd3e-73ea-4936-8b89-8fab3a72fd4b" # Action ID for: Generate Image with Custom Parameters

# Construct the exact input payload based on the action's requirements
# This example uses the predefined example_input for this action:
payload = {
  "goFast": false,
  "prompt": "CReate a head shot picture of mine in complete formals. Ensure its not taken from a very close angle and the head and body is proportionate. Also ensure that the pictures are formal featuring me in a custom suit.Create a pic in formal shirt and no beard and mustache . ",
  "loraScale": 1,
  "modelType": "dev",
  "numOutputs": 1,
  "aspectRatio": "1:1",
  "outputFormat": "webp",
  "guidanceScale": 3,
  "outputQuality": 80,
  "extraLoraScale": 1,
  "promptStrength": 0.8,
  "imageResolution": "1",
  "numInferenceSteps": 28
}

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

Atul Goa's image generation capabilities streamline the process of creating custom images, making it a powerful tool for developers looking to enhance their applications. With adjustable parameters and options for speed and quality, you can produce stunning visuals tailored to your needs.

Whether you're crafting marketing content, designing personal projects, or exploring creative possibilities, the potential applications are vast. Start integrating Atul Goa into your workflow today and unlock a new realm of image creation possibilities.