Generate Stunning Fashion Model Images with Cognitive Actions for Desigual Dresses

25 Apr 2025
Generate Stunning Fashion Model Images with Cognitive Actions for Desigual Dresses

In the world of fashion, visuals are everything. The spec titled stoodioai/desigual-multicoloured-dress provides a powerful set of Cognitive Actions designed for generating high-quality images of fashion models showcasing Desigual dresses. These pre-built actions allow developers to leverage advanced image generation techniques, enabling the creation of stunning visuals tailored to specific prompts. Whether you're building an e-commerce platform or enhancing a fashion app, these actions can help you automate and elevate your image generation process.

Prerequisites

Before diving into the integration of Cognitive Actions, ensure you have the following:

  • An API key for the Cognitive Actions platform to authenticate your requests.
  • Basic understanding of JSON structure and HTTP requests.

To authenticate, you typically pass the API key in the headers of your requests, allowing you to securely access the Cognitive Actions API.

Cognitive Actions Overview

Generate Fashion Model Image

The Generate Fashion Model Image action allows you to create high-quality images of fashion models based on descriptive prompts. Utilizing an image-to-image or inpainting process, this action supports custom dimensions and multiple output formats, making it versatile for various needs.

  • Category: Image Generation
  • Purpose: Generate fashion model images based on prompts, supporting various configurations for image quality and dimensions.

Input

The input for this action is structured as follows:

  • Required Fields:
    • prompt: A string detailing the image you want to generate. Example: "a female fashion model wearing multicoloured desigual-multicoloured-dress dress standing straight and looking at the camera, ecommerce photography, white background".
  • Optional Fields:
    • mask: Image mask for image inpainting.
    • seed: Random seed for reproducibility.
    • image: Input image for image-to-image or inpainting mode.
    • width: Width of the generated image (if aspect ratio is custom).
    • height: Height of the generated image (if aspect ratio is custom).
    • fastMode: Boolean to enable faster predictions.
    • loraScale: Scale for the main LoRA application.
    • megapixels: Approximate number of megapixels.
    • weightsURL: URL to load LoRA weights.
    • guidanceScale: Adjusts guidance scale for diffusion.
    • inferenceModel: Choose between 'dev' and 'schnell' models.
    • promptStrength: Strength of the prompt when using img2img.
    • numberOfOutputs: Number of images to generate.
    • imageOutputFormat: Format of the resulting images (e.g., 'webp', 'jpg', 'png').
    • aspectRatioSetting: Aspect ratio for the generated image.
    • imageOutputQuality: Quality of the output image.
    • additionalLoraScale: Extra scaling for LoRA application.
    • inferenceStepsCount: Number of denoising steps.
    • disableSafetyChecker: Option to disable the safety checker for generated images.
    • additionalLoraWeights: Load additional LoRA weights.

Here is an example of a valid JSON payload to invoke this action:

{
  "prompt": "a female fashion model wearing multicooured desigual-multicoloured-dress dress standing straight and looking at the camera, ecommerce photography, white background",
  "fastMode": false,
  "loraScale": 1,
  "megapixels": "1",
  "guidanceScale": 3,
  "inferenceModel": "dev",
  "promptStrength": 0.8,
  "numberOfOutputs": 1,
  "imageOutputFormat": "webp",
  "aspectRatioSetting": "2:3",
  "imageOutputQuality": 80,
  "additionalLoraScale": 1,
  "inferenceStepsCount": 28
}

Output

The action typically returns a URL pointing to the generated image. For example:

[
  "https://assets.cognitiveactions.com/invocations/53181fe1-e96b-43e9-9702-b3304b98b275/72c060be-c2d1-4d09-9128-9a47f90dbc9e.webp"
]

This URL can be used to display the generated image in your application.

Conceptual Usage Example (Python)

Here's how you might call the Generate Fashion Model Image 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 = "199e2fa6-bce5-4f3b-b8a8-a3facfcc7f4d" # Action ID for Generate Fashion Model Image

# Construct the input payload based on the action's requirements
payload = {
    "prompt": "a female fashion model wearing multicooured desigual-multicoloured-dress dress standing straight and looking at the camera, ecommerce photography, white background",
    "fastMode": False,
    "loraScale": 1,
    "megapixels": "1",
    "guidanceScale": 3,
    "inferenceModel": "dev",
    "promptStrength": 0.8,
    "numberOfOutputs": 1,
    "imageOutputFormat": "webp",
    "aspectRatioSetting": "2:3",
    "imageOutputQuality": 80,
    "additionalLoraScale": 1,
    "inferenceStepsCount": 28
}

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}
    )
    response.raise_for_status() 

    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 payload variable is structured based on the required inputs for the action, and the HTTP request sends this data to the Cognitive Actions endpoint.

Conclusion

The Generate Fashion Model Image action within the stoodioai/desigual-multicoloured-dress spec provides a powerful tool for developers looking to generate visually appealing fashion images automatically. By integrating this action, you can enhance your applications with stunning visuals, streamline your processes, and focus more on creativity rather than manual image creation. Experiment with the various parameters to find the best combination for your specific needs and take your fashion-related applications to the next level!