Create Stunning Photorealistic Images with Epicrealism V2

25 Apr 2025
Create Stunning Photorealistic Images with Epicrealism V2

Epicrealism V2 is an advanced image generation service designed to empower developers with the ability to create high-quality, photorealistic images effortlessly. With features such as img2img, inpainting, and customizable configurations, this service streamlines the process of generating stunning visuals. Whether you're working on game development, marketing materials, or artistic projects, Epicrealism V2 offers a simplified and efficient solution to meet your creative needs.

By leveraging the power of AI, Epicrealism V2 not only enhances your productivity but also opens up new possibilities for creative expression. Imagine generating unique images tailored to your specifications in a matter of moments, all while maintaining high standards of quality. This service is particularly beneficial for use cases such as concept art creation, product visualization, and even social media content generation.

Prerequisites

To get started with Epicrealism V2, you will need an API key for the Cognitive Actions service and a basic understanding of making API calls. This will allow you to seamlessly integrate the image generation capabilities into your applications.

Generate Realistic Image

The Generate Realistic Image action utilizes the EpicRealism model to produce high-quality, photorealistic images. This action addresses the challenge of creating visually appealing images from prompts or existing images, offering features like inpainting and negative embeddings for precise control over the output.

Input Requirements

The action accepts a variety of parameters to configure the image generation process, including:

  • Mask: A URI of the input mask for inpaint mode.
  • Seed: An integer to randomize the generation process.
  • Image: A URI of the input image for img2img or inpaint mode.
  • Width: The output image width (options ranging from 128 to 1024 pixels).
  • Height: The output image height (options ranging from 128 to 1024 pixels).
  • Prompt: A descriptive input prompt guiding the image generation.
  • Scheduler: Selection of the denoising scheduler used.
  • Guidance Scale: A value determining the strength of guidance (1 to 20).
  • Safety Checker: A boolean to enable or disable the safety checker.
  • Negative Prompt: Elements to avoid in the output image.
  • Prompt Strength: Strength of the prompt when using an initial image.
  • Number of Outputs: How many images to generate (1-4).
  • Number of Inference Steps: Total number of denoising steps (1-500).

Expected Output

The output will be a URI to the generated image, ensuring that you can easily access and utilize the stunning visuals created through this action.

Use Cases for this specific action

The Generate Realistic Image action is ideal for several scenarios:

  • Concept Art: Artists can quickly prototype visual ideas based on descriptive prompts.
  • Marketing Campaigns: Create tailored images for advertisements or social media posts that resonate with target audiences.
  • Game Development: Generate assets for characters or environments directly from initial concepts.
  • Product Visualization: Showcase products in a photorealistic manner for e-commerce or promotional 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 = "59a526eb-1afd-4782-8810-c58e657630a1" # Action ID for: Generate Realistic Image

# Construct the exact input payload based on the action's requirements
# This example uses the predefined example_input for this action:
payload = {
  "seed": 27128,
  "width": 576,
  "height": 1024,
  "prompt": "wide-shot, a woman, (freckles:0.9), depth of field, business woman, (photorealistic:1.4)",
  "scheduler": "KarrasDPM",
  "guidanceScale": 5,
  "safetyChecker": true,
  "negativePrompt": "BadDream, UnrealisticDream, FastNegativeV2",
  "promptStrength": 0.8,
  "numberOfOutputs": 1,
  "numberOfInferenceSteps": 30
}

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

Epicrealism V2 provides developers with an invaluable tool for generating high-quality, photorealistic images tailored to specific needs. The flexibility in configuration and the power of AI-driven generation allow for a wide range of applications, from art creation to marketing. By integrating this service into your projects, you can enhance visual storytelling, streamline your creative processes, and produce stunning imagery with ease. Start exploring the capabilities of Epicrealism V2 today and elevate your projects to new heights!