Create Stunning DIXIT-Style Images Using the ugleh/flux-dev-lora-dixit Cognitive Actions

23 Apr 2025
Create Stunning DIXIT-Style Images Using the ugleh/flux-dev-lora-dixit Cognitive Actions

The ugleh/flux-dev-lora-dixit API provides developers with a powerful tool for generating images that emulate the unique art style of the popular DIXIT board game. Leveraging the Flux LoRA model, this API allows for customizable image creation with various parameters, ensuring artistic expression in every piece. By utilizing these pre-built Cognitive Actions, developers can easily integrate advanced image generation capabilities into their applications, enhancing user experiences and creativity.

Prerequisites

To get started with the Cognitive Actions for the ugleh/flux-dev-lora-dixit API, you'll need the following:

  • API Key: You will require an API key to authenticate your requests. This key should be passed in the headers of your API calls.
  • Basic Setup: Ensure you have a development environment ready for making HTTP requests, such as Python with the requests library.

Cognitive Actions Overview

Generate Image in Dixit Art Style

Description: This action allows you to create images that mimic the distinctive art style of the DIXIT board game. It uses the Flux LoRA model, which is optimized for artistic expression, and offers a plethora of customizable parameters such as resolution, aspect ratio, and guidance scale.

  • Category: Image Generation

Input

The input for this action is structured as follows:

{
  "prompt": "A DIXIT image of toys in a toy store",
  "imageFormat": "webp",
  "outputCount": 1,
  "proportions": "1:1",
  "qualityLevel": 80,
  "loraIntensity": 1,
  "guidanceFactor": 3.5,
  "inferenceModel": "dev",
  "inferenceSteps": 28,
  "additionalLoraIntensity": 0.8
}

Required Fields:

  • prompt: A description of the image to be generated. (e.g., "A DIXIT image of toys in a toy store")

Optional Fields:

  • mask: URI for an image mask used in image inpainting mode.
  • seed: Integer for reproducible results.
  • image: Input image URI for image-to-image conversion.
  • width & height: Desired dimensions of the image.
  • fastMode: Enable optimized speed generation.
  • imageFormat: The format of the output image (default is webp).
  • outputCount: Number of images to generate (1-4).
  • proportions: Aspect ratio for the generated image.
  • qualityLevel: Image quality on a scale from 0 to 100.
  • loraIntensity: Strength of the main LoRA application.
  • guidanceFactor: Scale for the diffusion process.
  • inferenceModel: Model used for inference (dev or schnell).
  • inferenceSteps: Number of denoising steps for detail.
  • imageResolution: Approximate number of megapixels.
  • promptMagnitude: Intensity of the prompt when using transformations.
  • safetyCheckerOff: Toggle for the safety checker.
  • additionalLoraWeights: Additional LoRA weights.
  • additionalLoraIntensity: Strength of additional LoRA.

Output

The output is a URL link to the generated image:

[
  "https://assets.cognitiveactions.com/invocations/d5777181-b849-48e0-aa11-6d6225778893/d09ca4de-f931-4f33-a9dc-6a9f134eb9a5.webp"
]

Example Output: A link to the generated image in webp format.

Conceptual Usage Example (Python)

Here’s how you might call this action using Python:

import requests
import json

# Replace with your Cognitive Actions API key and endpoint
COGNITIVE_ACTIONS_API_KEY = "YOUR_COGNITIVE_ACTIONS_API_KEY"
COGNITIVE_ACTIONS_EXECUTE_URL = "https://api.cognitiveactions.com/actions/execute"  # Hypothetical endpoint

action_id = "ad1bc51a-0a89-4ce0-a590-f61169e1acec"  # Action ID for Generate Image in Dixit Art Style

# Construct the input payload based on the action's requirements
payload = {
    "prompt": "A DIXIT image of toys in a toy store",
    "imageFormat": "webp",
    "outputCount": 1,
    "proportions": "1:1",
    "qualityLevel": 80,
    "loraIntensity": 1,
    "guidanceFactor": 3.5,
    "inferenceModel": "dev",
    "inferenceSteps": 28,
    "additionalLoraIntensity": 0.8
}

headers = {
    "Authorization": f"Bearer {COGNITIVE_ACTIONS_API_KEY}",
    "Content-Type": "application/json"
}

try:
    response = requests.post(
        COGNITIVE_ACTIONS_EXECUTE_URL,
        headers=headers,
        json={"action_id": action_id, "inputs": payload}  # Hypothetical structure
    )
    response.raise_for_status()  # Raise an exception for bad status codes (4xx or 5xx)

    result = response.json()
    print("Action executed successfully:")
    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: {e.response.text}")

In this code snippet, replace YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key. The action ID is specified for the "Generate Image in Dixit Art Style" action. The input payload is structured according to the requirements, and the output will contain the URL of the generated image.

Conclusion

The ugleh/flux-dev-lora-dixit Cognitive Actions offer a robust solution for generating visually appealing images that capture the essence of DIXIT's art style. By utilizing these actions, developers can enhance their applications with creative and unique image generation capabilities. Explore various configurations and parameters to find the perfect settings for your needs, and start bringing your artistic visions to life!