Skip to content

Prompt Enhancement

Human language is often too concise, which can lead to a lack of detail in AI results. This feature uses LLMs to expand simple keywords into professional prompts containing details on lighting, materials, and composition, significantly improving image quality.

Typical Application Scenarios

  • Generation Assistant: Helps users optimize inputs, enabling even beginners to generate master-level works.
  • Automated Workflows: Pre-process raw inputs for quality in batch generation tasks.

API Reference used on this page POST /images/prompt_enhancements

Basic Examples

bash
curl -X POST 'https://api.v2fun.ai/api/v1/images/prompt_enhancements' \
  -H 'Authorization: Bearer $V2FUN_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
      "prompt": "A beautiful sunset over the mountains",
      "system_prompt": "You are a helpful assistant that generates detailed image descriptions from simple prompts."
    }'
javascript
const response = await fetch('https://api.v2fun.ai/api/v1/images/prompt_enhancements', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer $V2FUN_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "prompt": "A beautiful sunset over the mountains",
    "system_prompt": "You are a helpful assistant that generates detailed image descriptions from simple prompts."
  }),
});
const data = await response.json();
python
import requests

resp = requests.post(
    'https://api.v2fun.ai/api/v1/images/prompt_enhancements',
    headers={
        'Authorization': 'Bearer $V2FUN_API_KEY',
        'Content-Type': 'application/json',
    },
    json={
        "prompt": "A beautiful sunset over the mountains",
        "system_prompt": "You are a helpful assistant that generates detailed image descriptions from simple prompts."
    },
)
print(resp.json())
java
import java.net.URI;
import java.net.http.*;

HttpClient client = HttpClient.newHttpClient();
String body = "{\"prompt\":\"A beautiful sunset over the mountains\",\"system_prompt\":\"You are a helpful assistant that generates detailed image descriptions from simple prompts.\"}";
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.v2fun.ai/api/v1/images/prompt_enhancements"))
    .header("Authorization", "Bearer $V2FUN_API_KEY")
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString(body))
    .build();
HttpResponse<String> response = client.send(
    request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());

Core Use Cases

Smart Prompt Expansion

Enter a simple concept (like "girl in forest") to get an enhanced prompt with specific environmental descriptions, art style definitions, and lighting details.

bash
curl -X POST 'https://api.v2fun.ai/api/v1/images/prompt_enhancements' \
  -H 'Authorization: Bearer $V2FUN_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
      "prompt": "a girl in forest",
      "system_prompt": "Expand the input into a vivid, detailed description suitable for high-quality image generation."
    }'
javascript
const response = await fetch('https://api.v2fun.ai/api/v1/images/prompt_enhancements', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer $V2FUN_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "prompt": "a girl in forest",
    "system_prompt": "Expand the input into a vivid, detailed description suitable for high-quality image generation."
  }),
});
const data = await response.json();
python
import requests

resp = requests.post(
    'https://api.v2fun.ai/api/v1/images/prompt_enhancements',
    headers={
        'Authorization': 'Bearer $V2FUN_API_KEY',
        'Content-Type': 'application/json',
    },
    json={
        "prompt": "a girl in forest",
        "system_prompt": "Expand the input into a vivid, detailed description suitable for high-quality image generation."
    },
)
print(resp.json())
java
import java.net.URI;
import java.net.http.*;

HttpClient client = HttpClient.newHttpClient();
String body = "{\"prompt\":\"a girl in forest\",\"system_prompt\":\"Expand the input into a vivid, detailed description suitable for high-quality image generation.\"}";
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.v2fun.ai/api/v1/images/prompt_enhancements"))
    .header("Authorization", "Bearer $V2FUN_API_KEY")
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString(body))
    .build();
HttpResponse<String> response = client.send(
    request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
Original Prompt
a girl in forest
Output
A photorealistic portrait of a young woman standing gracefully in an ancient temperate forest during golden hour. She has shoulder-length wavy chestnut hair, fair skin, wearing a flowing linen dress. Sunlight pierces through the canopy in visible volumetric rays, casting dappled patterns. Shot with shallow depth of field, cinematic color grading, 8K resolution.