Create Stunning Artwork with Fomenko's Image Generation Action

26 Apr 2025
Create Stunning Artwork with Fomenko's Image Generation Action

In the realm of digital art, the ability to create unique and captivating images is invaluable. Fomenko's image generation action harnesses the power of advanced AI to produce artwork inspired by the distinctive style of Anatoly Fomenko. This service allows developers to generate images with high customization options, including the ability to refine and personalize each output. Whether you're building a creative project, enhancing a digital gallery, or developing a game, Fomenko offers a streamlined solution for generating visually stunning images at scale.

With Fomenko, developers can quickly create artistic pieces that stand out, saving time and effort while achieving professional-quality results. Common use cases include generating illustrations for books, creating concept art for games, or simply experimenting with unique artistic styles. The flexibility of the input parameters means that you can tailor your creations to meet specific needs, making it an essential tool in any developer's toolkit.

Prerequisites

To get started with Fomenko's image generation action, you will need an API key for the Cognitive Actions service and a basic understanding of how to make API calls.

Generate Image in Fomenko Style

The "Generate Image in Fomenko Style" action allows you to create images that reflect Anatoly Fomenko's artistic vision, utilizing the SDXL model for optimal results. This action solves the problem of generating visually appealing artwork by providing a wide range of customization options, enabling users to refine their images and apply specific styles.

Input Requirements:

  • Prompt: A text prompt that describes the desired image.
  • Width & Height: Specify the dimensions of the output image in pixels (default is 1024x1024).
  • Guidance Scale: Controls the adherence to the prompt, with a range from 1 to 50.
  • Refine Style: Choose a refinement method to enhance the image.
  • Number of Outputs: Specify how many images to generate (1 to 4).

Example Input:

{
  "width": 1024,
  "height": 1024,
  "prompt": "in style of fomenko a black and white drawing of a man head looking at monolith floating in space surrounded by planets and geometric abstractions",
  "loraScale": 0.6,
  "refineStyle": "no_refiner",
  "guidanceScale": 7.5,
  "schedulerType": "K_EULER",
  "applyWatermark": false,
  "negativePrompt": "",
  "promptStrength": 0.8,
  "numberOfOutputs": 1,
  "highNoiseFraction": 0.8,
  "numInferenceSteps": 50
}

Expected Output: A URL linking to the generated artwork, such as:

"https://assets.cognitiveactions.com/invocations/6861a8c3-1735-492f-b37e-339d0b9ef000/0cefb33c-4151-4564-885b-6766038a9916.png"

Use Cases for this Specific Action:

  • Digital Art Creation: Artists can explore new styles and concepts without the need for traditional tools.
  • Game Development: Developers can generate assets that fit unique artistic visions or themes.
  • Content Generation: Writers and marketers can create compelling visuals for blogs, social media, 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 = "729306dd-84ec-4e71-bcb6-65164519ec8c" # Action ID for: Generate Image in Fomenko Style

# Construct the exact input payload based on the action's requirements
# This example uses the predefined example_input for this action:
payload = {
  "width": 1024,
  "height": 1024,
  "prompt": "in style of fomenko a black and white drawing of a man head looking at monolith floating in space surrounded by planets and geometric abstractions",
  "loraScale": 0.6,
  "refineStyle": "no_refiner",
  "guidanceScale": 7.5,
  "schedulerType": "K_EULER",
  "applyWatermark": false,
  "negativePrompt": "",
  "promptStrength": 0.8,
  "numberOfOutputs": 1,
  "highNoiseFraction": 0.8,
  "numInferenceSteps": 50
}

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

Fomenko's image generation action opens up a world of creative possibilities for developers looking to enhance their projects with stunning artwork. By leveraging this powerful tool, you can quickly produce customized images that meet your specific requirements, helping you to stand out in a crowded digital landscape. Whether you're an artist, game developer, or content creator, integrating Fomenko into your workflow can streamline your creative process and elevate the quality of your output. Start exploring the artistic potential today!