Generate Stunning Wine Glass Images with the Full Wine Glass Cognitive Actions

22 Apr 2025
Generate Stunning Wine Glass Images with the Full Wine Glass Cognitive Actions

In the world of image generation, the dogud/full-wine-glass API provides a unique and creative solution for developers looking to create visually appealing content. This API allows you to generate images of full to the brim wine glasses using a specialized FLUX model. While the model is trained on a limited set of low-quality images, it's a fun tool for creating unique visuals, and contributions of better photos are welcomed to enhance its performance. In this article, we will explore how to utilize this action effectively in your applications.

Prerequisites

Before diving into the integration, ensure you have the following:

  • An API key for the Cognitive Actions platform.
  • Basic understanding of making HTTP requests.
  • Familiarity with JSON format for constructing input payloads.

Authentication typically involves passing your API key in the headers of your requests.

Cognitive Actions Overview

Generate Full to the Brim Wine Glass Images

The Generate Full to the Brim Wine Glass Images action is designed to create images of wine glasses filled to the brim. This action falls under the category of image-generation and utilizes a fine-tuned model to produce interesting visuals based on user-defined prompts.

Input

The input schema for this action requires a variety of fields, with the prompt being mandatory. Here’s a breakdown of the required and optional parameters:

  • prompt (required): A string that specifies the scene you want to generate. For example, "A full to the brim wine glass, filled with red wine FBWG".
  • model (optional): Select between dev or schnell, with dev being the default.
  • goFast (optional): A boolean to enable faster predictions.
  • imageSize (optional): The size of the image in megapixels.
  • outputCount (optional): The number of outputs to generate (1 to 4).
  • outputFormat (optional): The format of the output images (webp, jpg, png).
  • guidanceScale, outputQuality, inferenceSteps, and more are also configurable to fine-tune the output.

Here is an example of a JSON payload for this action:

{
  "model": "dev",
  "goFast": false,
  "prompt": "A full to the brim wine glass, filled with red wine FBWG",
  "imageSize": "1",
  "loraScale": 1,
  "aspectRatio": "1:1",
  "outputCount": 1,
  "outputFormat": "webp",
  "guidanceScale": 3,
  "outputQuality": 80,
  "extraLoraScale": 1,
  "inferenceSteps": 28,
  "promptStrength": 0.8
}

Output

The output of this action is an array of URLs pointing to the generated images. Here’s an example of what you can expect as a response:

[
  "https://assets.cognitiveactions.com/invocations/99dfa7ce-6fe8-42d0-8777-60c1b598d00b/8c3a3ef2-cd51-4ae5-97f3-fcbc085dcf89.webp"
]

Conceptual Usage Example (Python)

Below is a conceptual Python code snippet demonstrating how to call the Cognitive Actions execution endpoint:

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 = "725d925e-055e-4af0-b1f1-ee5594a6e22e"  # Action ID for Generate Full to the Brim Wine Glass Images

# Construct the input payload based on the action's requirements
payload = {
    "model": "dev",
    "goFast": False,
    "prompt": "A full to the brim wine glass, filled with red wine FBWG",
    "imageSize": "1",
    "loraScale": 1,
    "aspectRatio": "1:1",
    "outputCount": 1,
    "outputFormat": "webp",
    "guidanceScale": 3,
    "outputQuality": 80,
    "extraLoraScale": 1,
    "inferenceSteps": 28,
    "promptStrength": 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 snippet, you'll replace YOUR_COGNITIVE_ACTIONS_API_KEY with your actual API key and set the action ID accordingly. The payload is structured based on the action's requirements, and the response is handled gracefully.

Conclusion

The dogud/full-wine-glass API offers a creative way for developers to generate stunning images of wine glasses filled to the brim. By leveraging the customizable input options, you can create unique graphics tailored to your application's needs. Explore the potential of these Cognitive Actions to enhance your projects with visually appealing content today! Whether you're looking to create graphics for marketing materials, social media, or any other use case, this action can help you achieve your goals effectively.