Generate Stunning Blade Runner 2049 Style Images with Cognitive Actions

23 Apr 2025
Generate Stunning Blade Runner 2049 Style Images with Cognitive Actions

In the realm of AI-driven creativity, the doriandarko/sdxl-bladerunner2049 API offers a unique Cognitive Action that allows developers to generate visually striking images inspired by the aesthetics of the film Blade Runner 2049. This action leverages the powerful SDXL model, which has been trained on film stills to provide an authentic artistic style. With customizable options such as image refinement, prompt intensity, and safety measures, integrating this action can enhance applications in gaming, art, and media.

Prerequisites

To get started with the Cognitive Actions, you’ll need to have access to the API, which typically requires an API key for authentication. This API key should be included in the headers of your requests, allowing you to securely access the image generation features.

Cognitive Actions Overview

Generate Blade Runner 2049 Style Image

The Generate Blade Runner 2049 Style Image action creates images that embody the unique visual style of Blade Runner 2049. By providing a descriptive prompt, developers can influence the generated output, ensuring it aligns with their creative vision.

Input

The action requires a structured input schema, which includes the following fields:

  • Mask (optional): URI pointing to the input mask for inpaint mode. Black areas will be preserved, while white areas will be inpainted.
  • Image (optional): URI pointing to the input image for img2img or inpaint mode.
  • Width: Width of the output image in pixels (default is 1024).
  • Height: Height of the output image in pixels (default is 1024).
  • Prompt: The text prompt guiding the image generation (must include "in the style of br2049").
  • Lora Scale: Additive scale factor for LoRA models (default is 0.6).
  • Random Seed (optional): Seed value for randomization.
  • Output Count: Number of images to generate (default is 1, max 4).
  • Refinement Style: Choose a refinement style for the image generation (default is "no_refiner").
  • Scheduler Type: Determines the scheduling algorithm (default is "K_EULER").
  • Custom Weights (optional): Specifies custom LoRA weights.
  • Guidance Scale: Adjusts the intensity of guidance (default is 7.5).
  • Apply Watermark: Indicates if a watermark is applied (default is true).
  • Negative Prompt (optional): Specifies what to avoid in the generated image.
  • Prompt Strength: Strength of the prompt's effect (default is 0.8).
  • Refine Steps (optional): Number of refinement steps for base image refinements.
  • High Noise Fraction: Fraction of noise used in the expert refiner (default is 0.8).
  • Num Inference Steps: Number of denoising steps (default is 50).
  • Disable Safety Checker: Indicates if the safety checker is disabled (default is false).

Example Input:

{
  "width": 1024,
  "height": 1024,
  "prompt": "in the style of br2049 nighttime scene of a woman in purple outfit in a room with purple lighting",
  "loraScale": 0.6,
  "outputCount": 1,
  "refineStyle": "no_refiner",
  "scheduleType": "K_EULER",
  "guidanceScale": 7.5,
  "applyWatermark": true,
  "promptStrength": 0.8,
  "highNoiseFraction": 0.8,
  "numInferenceSteps": 50
}

Output

The action typically returns a URL(s) to the generated image(s). For example:

[
  "https://assets.cognitiveactions.com/invocations/f9ab08c1-2679-467a-b443-64082d23edaa/17fe118c-5363-4844-afeb-8ff211c9d3d5.png"
]

Conceptual Usage Example (Python)

Here’s a conceptual Python code snippet illustrating how to invoke the action:

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 = "ae1ff342-a17c-4d85-9f69-a9c5f2576cdb"  # Action ID for Generate Blade Runner 2049 Style Image

# Construct the input payload based on the action's requirements
payload = {
    "width": 1024,
    "height": 1024,
    "prompt": "in the style of br2049 nighttime scene of a woman in purple outfit in a room with purple lighting",
    "loraScale": 0.6,
    "outputCount": 1,
    "refineStyle": "no_refiner",
    "scheduleType": "K_EULER",
    "guidanceScale": 7.5,
    "applyWatermark": true,
    "promptStrength": 0.8,
    "highNoiseFraction": 0.8,
    "numInferenceSteps": 50
}

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 the placeholders with your actual API key and action ID. The structured input payload is created based on the required fields, and the request is sent to the hypothetical endpoint.

Conclusion

The doriandarko/sdxl-bladerunner2049 Cognitive Action provides an exciting way for developers to generate stunning images that capture the essence of Blade Runner 2049. With various customization options, you can create unique visuals tailored to your application's needs. Consider exploring additional use cases, such as creating artwork for games or enhancing multimedia projects, to fully leverage the capabilities of this powerful tool.