Create Stunning Hyper-Realistic Images with Fanta Lemon

27 Apr 2025
Create Stunning Hyper-Realistic Images with Fanta Lemon

In today's digital landscape, the ability to generate high-quality, hyper-realistic images can greatly enhance user engagement and creativity. The Fanta Lemon service provides developers with powerful Cognitive Actions to seamlessly generate stunning visuals, making it an essential tool for applications in various industries. This service is designed for speed and simplification, allowing you to create images with ease while providing advanced features like inpainting and prompt customization. Whether you're developing a marketing campaign, enhancing a gaming experience, or creating content for social media, Fanta Lemon allows you to transform your ideas into visually captivating images.

Prerequisites

To get started with Fanta Lemon, you'll need an API key for the Cognitive Actions service and a basic understanding of making API calls.

Generate Hyper-Realistic Images

This action generates high-quality, hyper-realistic images using the Dev or Schnell inference models. It includes advanced options for inpainting, prompt intensity, and fast mode, allowing for detailed and optimized image creation.

Input Requirements

The input for this action requires a well-defined prompt, which serves as the foundation for the generated image. Additional parameters such as image dimensions, aspect ratio, seed for reproducibility, and model selection can further refine the output. The following is a brief overview of the required and optional input fields:

  • Prompt: A detailed description of the image you want to generate.
  • Mask: (optional) URI of an image mask for inpainting.
  • Image: (optional) URI of an input image for image-to-image processing.
  • Width/Height: (optional) Dimensions for the generated image.
  • Inference Model: Choose between "dev" and "schnell" for different processing speeds and quality.

Expected Output

The output will be a high-resolution image based on the provided prompt, with the format and quality defined in the input parameters. An example of the output could be a JPEG or PNG image link that directs to the generated image.

Use Cases for this Specific Action

  • Marketing Campaigns: Create eye-catching visuals for advertisements that resonate with your target audience.
  • Gaming: Generate unique character designs or immersive environments to enhance gameplay experiences.
  • Content Creation: Produce high-quality images for blogs, social media, or websites, elevating the overall aesthetic appeal.
  • Art and Design: Explore creative avenues by generating artwork or design concepts based on prompts tailored to specific themes or styles.
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 = "b045e8d5-19c1-4bc7-be75-5eb5131bbf0c" # Action ID for: Generate Hyper-Realistic Images

# Construct the exact input payload based on the action's requirements
# This example uses the predefined example_input for this action:
payload = {
  "prompt": "prompt=\"Here's an enhanced version of your prompt, aimed at creating a hyper-realistic, high-quality photograph-like image:\\n\\n[Carlosm] sitting in the driver's seat of a gleaming red Ferrari sports car, holding a chilled glass of golden beer. The interior of the luxury vehicle is captured in stunning detail, showcasing the fine leather upholstery, polished carbon fiber accents, and state-of-the-art dashboard. [Carlosm]'s expression is relaxed and content, with a slight smile as he raises the beer glass. Soft, warm evening light filters through the car's windows, creating a cozy ambiance. The Ferrari's iconic prancing horse logo is visible on the steering wheel, adding authenticity to the scene. The image captures the essence of luxury, relaxation, and indulgence in a photorealistic style.\\n\\nNegative Prompt: No distortions, malformations, or unnatural proportions in human figures, facial features, limbs, or body parts. No duplicate or identical faces among secondary subjects; all faces must be unique and distinct. No floating, missing, or misplaced elements. No anachronistic, unrelated, or unmentioned objects, accessories, or clothing. No inconsistent, incorrect, or incomplete logos, text, or symbols. No unrealistic colors, exaggerated lighting, harsh contrasts, or inconsistent shadows. No blurry, pixelated, low-resolution, or poorly rendered details. Textures, surfaces, and materials must be natural, sharp, and highly detailed. Avoid visual artifacts, glitches, or unnatural blending of any kind. All elements must have accurate sizes, scales, and spatial relationships. The image must be hyper-realistic, perfectly coherent, and aligned with real-world physics, lighting, and proportions. Ensure a clean, polished, and photorealistic final composition free from clutter, visual noise, or distractions.\"",
  "enableFastMode": false,
  "inferenceModel": "dev",
  "imageMegapixels": "1",
  "numberOfOutputs": 1,
  "imageAspectRatio": "1:1",
  "outputImageFormat": "png",
  "imageOutputQuality": 80,
  "additionalLoraScale": 1,
  "imagePromptStrength": 0.8,
  "inferenceStepsCount": 28,
  "loraApplicationScale": 1,
  "additionalLoraWeights": "https://replicate.delivery/xezq/2zFIXstgEdpzB9pHuRj5tJKqrecs1U0lJUZOeNUVWVw8C55TA/trained_model.tar",
  "diffusionGuidanceScale": 3
}

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 Fanta Lemon service, with its ability to generate hyper-realistic images, opens up a world of possibilities for developers looking to enhance their applications with visually stunning content. With its advanced features and user-friendly interface, you can quickly create images that not only attract attention but also convey your brand's message effectively. As you explore the various use cases, consider how integrating this powerful action can elevate your projects and engage your audience in new and exciting ways. Start experimenting with Fanta Lemon today and unlock your creative potential!