Image Generation
1. Introduction to Image Generation Models
The platform provides two main usage methods for image generation models: one is generating images directly based on prompt input, and the other is generating image variants based on existing images combined with prompt input.
-
Creating Images Based on Text Prompts
When using text-to-image models, carefully designing the input prompt is crucial for generating high-quality images. Below are some tips for crafting prompts to improve the quality of generated images:
-
Specific Descriptions: Provide as much detail as possible about the image you want to generate. For example, instead of simply inputting “beach sunset,” you could try “A tranquil beach at sunset, with the sky glowing orange and red, gentle waves lapping at the shore, and a small boat in the distance.”
-
Emotion and Atmosphere: In addition to describing the content of the image, include descriptions of the emotion or atmosphere, such as “warm,” “mysterious,” or “vibrant,” to help the model better understand the desired style.
-
Style Specification: If you have a preference for a particular artistic style, such as “Impressionism” or “Surrealism,” explicitly mention it in the prompt to increase the likelihood of the generated image meeting your expectations.
-
Avoid Vague Terms: Try to avoid using overly abstract or vague terms, such as “beautiful” or “nice,” as these are difficult for the model to concretize and may lead to results that deviate from your expectations.
-
Use Negative Prompts: If you want to exclude certain elements from the image, use negative prompts. For example, “Generate an image of a beach sunset, but without any boats.”
-
Step-by-Step Inputs: For complex scenes, try breaking the prompt into steps—first generate a base image, then adjust or add details as needed.
-
Experiment with Different Descriptions: Sometimes, even when describing the same scene, different wording can yield different results. Experiment with various angles or phrasing to find the most satisfactory outcome.
-
Leverage Model-Specific Features: Some models may offer specific features or parameter adjustment options, such as controlling image resolution or style intensity. Utilizing these features can also help improve the quality of generated images.
-
By following these methods, you can effectively enhance the quality of images generated using text-to-image models. However, since different models may have unique characteristics and preferences, practical usage may require adjustments based on the specific model’s features and feedback.
Here are some example prompts:
A futuristic eco-friendly skyscraper in central Tokyo. The building incorporates lush vertical gardens on every floor, with cascading plants and trees lining glass terraces. Solar panels and wind turbines are integrated into the structure’s design, reflecting a sustainable future. The Tokyo Tower is visible in the background, contrasting the modern eco-architecture with traditional city landmarks.
An elegant snow leopard perched on a cliff in the Himalayan mountains, surrounded by swirling snow. The animal’s fur is intricately detailed with distinctive patterns and a thick winter coat. The scene captures the majesty and isolation of the leopard’s habitat, with mist and mountain peaks fading into the background.
-
Generating Image Variants Based on Existing Images
Some image generation models support creating image variants based on existing images. In this case, it is still necessary to input an appropriate prompt to achieve the desired effect. Refer to the prompt crafting tips above for guidance.
2. Experience the Feature
You can explore the image generation feature via Image Generation or use the API Documentation to make API calls.
-
Key Parameter Descriptions
-
image_size: Controls the resolution of the generated image. When making API requests, you can customize various resolutions.
-
num_inference_steps: Controls the number of steps for image generation.
-
batch_size: Specifies the number of images to generate at once. The default value is 1, and the maximum value is 4.
-
negative_prompt: Allows you to specify elements you do not want to appear in the image, removing potential unwanted factors.
-
seed: To generate consistent images across multiple runs, set the seed to a fixed value.
-
3. Supported Models
Currently supported image generation models:
- Text-to-Image Series:
- black-forest-labs Series:
- black-forest-labs/FLUX.1-dev
- black-forest-labs/FLUX.1-schnell
- black-forest-labs Series: