POST
javascript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 const axios = require('axios'); const api_key = "YOUR API KEY"; const url = "https://api.segmind.com/workflows/66ba4126364d0f944f366a8f-v2"; const data = { text_prompt: "the user input string" }; axios.post(url, data, { headers: { 'x-api-key': api_key, 'Content-Type': 'application/json' } }).then((response) => { console.log(response.data); });
Response
application/json
1 2 3 4 5 { "poll_url": "<base_url>/requests/<some_request_id>", "request_id": "some_request_id", "status": "QUEUED" }

You can poll the above link to get the status and output of your request.

Response
application/json
1 2 3 { "image_output": "image in URL Format" }

Attributes


text_promptstr*

To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.

AI Art Generator using Flux.1: From Text to Masterpiece

This workflow demonstrates how AI models can transform a simple text description into a stunning digital painting. The process involves three key steps:

  1. Initial Text Input: The user provides a brief text description of the desired image. In this case, it's "goddess woman playing guitar with passion in saree". You can change this prompt or the art type in the prompt to experiment with different styles.

  2. Prompt Enhancement: A Llama 3.1 70b language model expands the initial description into a more detailed, evocative prompt. This step enriches the original concept with specific details about style, mood, and composition.

  3. Image Generation: The enhanced prompt is fed into a Flux.1 Schnell image generation model, which creates a high-quality digital painting based on the detailed description.

The result is a visually striking image that closely matches the expanded prompt, showcasing a woman playing a guitar with intense emotion and detail.

This workflow demonstrates the potential of AI in creative processes, allowing artists and designers to quickly generate complex, detailed images from simple text descriptions. It opens up new possibilities for rapid prototyping, concept art, and digital content creation.