Enhancing Images with Styles and Quality Modifiers in Python
Introduction to Styles and Quality Modifiers
Welcome back! In the previous lesson, you learned how to craft effective prompts by focusing on the key components: subject, context, and style. This lesson builds on that foundation by introducing you to styles and quality modifiers, which help shape the final look of your generated images.
By the end of this lesson, you will understand how to combine these elements to create visually stunning and high-quality images using the Gemini API.
Understanding Quality Modifiers
Quality modifiers are descriptive keywords that guide the model toward a more polished or detailed output in terms of aesthetic and composition. Examples include:
"high-quality""high definition""HDR""high-detail""cinematic lighting""ultra-realistic"
It is important to note that these keywords affect the visual style and perceived detail of the generated image, but they do not change the technical resolution or dimensions (pixel count). While modifiers make the image look higher quality, the actual image size is controlled by the image_size parameter within the image_config.
For example, this prompt:
may produce a simple image.
But this prompt:
gives the model stronger visual guidance to include more intricate textures and better lighting within the standard output resolution.
Exploring Artistic Styles
Artistic styles define the visual approach of the generated image. You can use styles such as:
photorealisticoil paintingwatercolordigital artsketchcyberpunkfantasy illustration
For example:
will likely produce a different visual result than:
Combining Styles with Quality Modifiers: Code Example
