Create Stunning Architectural Visuals with the FormFinder Flux Actions

22 Apr 2025
Create Stunning Architectural Visuals with the FormFinder Flux Actions

In the realm of digital creativity, the "ismail-seleit/formfinder-flux" API offers a powerful set of Cognitive Actions designed for generating atmospheric architecture images. Leveraging advanced models, these pre-built actions enable developers to create visually stunning images that can range from realistic to fantastical, opening up endless possibilities for artistic expression in applications. This guide will walk you through the key action available, detailing its purpose, input requirements, expected outputs, and how to seamlessly integrate it into your applications.

Prerequisites

Before diving into the Cognitive Actions, ensure that you have the following prerequisites:

  • API Key: You will need an API key for the Cognitive Actions platform to authenticate your requests.
  • Basic Setup: Familiarity with making API calls and handling JSON data will be beneficial.

To authenticate your requests, you will typically pass the API key in the headers of your HTTP requests.

Cognitive Actions Overview

Generate Atmospheric Architecture Images

Purpose: This action creates moody atmospheric images featuring versatile architectural designs. It allows for the generation of unique visuals that can merge various styles through the use of additional LoRA (Low-Rank Adaptation) weights.

Category: Image Generation

Input

The input schema for this action is defined as a composite request. Here’s an overview of the required and optional fields:

  • Required:
    • prompt: A descriptive text prompt that guides the image generation.
  • Optional:
    • mask: URL for an image mask used in inpainting mode.
    • seed: An integer seed for reproducibility.
    • image: Input image URL for image-to-image transformations.
    • width: Width of the generated image (must be a multiple of 16).
    • height: Height of the generated image (must be a multiple of 16).
    • goFast: Boolean to enable faster predictions.
    • extraLora: URL for loading additional LoRA weights.
    • loraScale: Determines the strength of the main LoRA.
    • numOutputs: The number of images to generate (1-4).
    • guidanceScale: Scale for guiding the diffusion process.
    • outputQuality: Quality of the output image.
    • extraLoraScale: Strength of the extra LoRA application.
    • inferenceModel: Selects the model for inference.
    • promptStrength: Strength of the prompt in img2img operations.
    • imageMegapixels: Approximate megapixel count.
    • imageAspectRatio: Aspect ratio for the generated image.
    • imageOutputFormat: Format for the output images.
    • numInferenceSteps: Number of denoising steps.
    • alternativeWeights: Load additional LoRA weights.
    • disableSafetyChecker: Option to disable the safety checker.

Example Input:

{
  "width": 1024,
  "height": 1024,
  "prompt": "Envision an otherworldly skyscraper suspended mid-air, defying physics with an unprecedented, avant-garde design that blurs architecture and art. This gravity-defying marvel boasts undulating curves, twisted steel beams, and glowing, iridescent surfaces that seem to shift and shimmer in the light.",
  "loraScale": 0.63,
  "numOutputs": 1,
  "guidanceScale": 1,
  "outputQuality": 80,
  "extraLoraScale": 0.8,
  "inferenceModel": "schnell",
  "imageAspectRatio": "1:1",
  "imageOutputFormat": "webp",
  "numInferenceSteps": 4
}

Output

The action typically returns an array of URLs pointing to the generated images. Here’s an example of the expected output:

Example Output:

[
  "https://assets.cognitiveactions.com/invocations/1fa54e31-7ad5-4c4d-9d7f-118dcd0a4e84/4a12aa32-5cce-42f3-859a-44c61772b220.webp"
]

Conceptual Usage Example (Python)

Here’s a conceptual example of how you might call the Cognitive Actions execution endpoint 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 = "2f695042-b9d4-4039-88d8-b4d794786a98" # Action ID for Generate Atmospheric Architecture Images

# Construct the input payload based on the action's requirements
payload = {
    "width": 1024,
    "height": 1024,
    "prompt": "Envision an otherworldly skyscraper suspended mid-air, defying physics with an unprecedented, avant-garde design...",
    "loraScale": 0.63,
    "numOutputs": 1,
    "guidanceScale": 1,
    "outputQuality": 80,
    "extraLoraScale": 0.8,
    "inferenceModel": "schnell",
    "imageAspectRatio": "1:1",
    "imageOutputFormat": "webp",
    "numInferenceSteps": 4
}

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 and the constructed input payload are tailored to the requirements of the "Generate Atmospheric Architecture Images" action. This example demonstrates how to structure the request and handle the response effectively.

Conclusion

The "ismail-seleit/formfinder-flux" Cognitive Action for generating atmospheric architecture images offers developers a robust tool for creating striking visuals. By leveraging the capabilities of this action, you can enhance your applications with unique imagery that captivates and engages users. As a next step, consider experimenting with different prompts and parameters to explore the full potential of this action in your projects. Happy coding!