Skip to content

Instantly share code, notes, and snippets.

@teocci
Created November 20, 2024 08:20
Show Gist options
  • Save teocci/5c4dc815647643f69f3378b0279a9508 to your computer and use it in GitHub Desktop.
Save teocci/5c4dc815647643f69f3378b0279a9508 to your computer and use it in GitHub Desktop.

Prompt Teaching A prompt is a method used to adjust the text-to-image model. By inputting the content and effect you want, the model can understand your intention and generate images that meet your expectations. To ensure the model clearly understands and generates high-quality images, a good prompt needs to be rich in content and clearly described. This process is similar to when a teacher assigns us homework: if the teacher asks us to draw a picture without specifying what elements should be included and the purpose of the drawing, we would be unsure how to start. Similarly, the model also needs accurate and clear instructions when generating images. The more specific the prompt description, the more accurate and stable the generated image will be. If you only input “a girl” without specifying her “appearance”, “location”, “time”, “action”, or “details of the scene”, the model will generate an image result based on its own interpretation.

prompt:

A girl

However, if you have specific requirements for the generated image content, such as “a girl with brown hair” “wearing a dress” “in a coffee shop” “on a summer afternoon” “eating an apple” with “oil painting style, extreme detail, medium shot”, the model will have difficulty accurately guessing your requirements.

prompt:

Chinese girl with brown hair wearing a dress eating an apple in a coffee shop on a summer afternoon, oil painting style,
with extreme detail, medium shot.

So how can you achieve such a rich and detailed image effect? We have prepared the “5W1H" formula for you, hoping to help you create more quickly and easily.

Who, What, When, Where, Why and How

Elements Description Examples
Who Main Subject: The main subject of the image can be described as a person, animal, plant, food, building, or other object. 1. Characters: doctor, dancer, doctor, magician, clown... 2. Animals: giraffe, parrot, polar bear, dolphin, snail... 3. Plants: cherry blossom tree, sunflower, cactus, eucalyptus tree, rose.. 4. Food: spaghetti, sushi, strawberry cake, roasted chicken, ice cream... 5. Buildings: castle, skyscraper, wooden house, temple, library... 6. Other objects: electric guitar, telescope, hot air balloon, sandglass, antique
What Subject Description: A detailed and specific textual description of the main object or focal point in the image. 1. Define the subject clearly: Clearly define the main object of the image, such as a person, animal, building, etc., for example: ‘A professor wearing a doctoral cap...” 2. Provide characteristics: Describe the appearance, posture, clothing, and other characteristics of the subject, for example: “A young female scientist wearing a white lab coat... 3. Specific situation: Describe the scene or context in which the subject is located, for example: “An astronaut standing at the hatch of a spaceship...” 4. Combine emotion and behavior: Describe the subject’s emotional state and ongoing actions in detail, for example: “An elderly person smiling and reading a book..." Specific Examples 1. A young female doctor wearing a white coat, holding a stethoscope, smiling and looking at the camera. 2. Acalorful parrot in flight, with its wings spread wide, against a backdrop of blue sky and white clouds. 3. A massive redwood tree, towering into the clouds, surrounded by a dense forest. 4. Afresh sushi platter, including salmon, tuna, and eel, accompanied by a small bowl of soy sauce and wasabi. 5. An ancient stone bridge spanning over a clear river, with lush green trees and flowers on both banks.
When Time: The time node at which the scene in the image occurs 1. Specific time points: dawn, noon, 6 pm, midnight (12 am), 3 am... 2. Time periods: morning, afternoon, evening, night, late night.. 3. Historical time nodes: Renaissance, Industrial Revolution, Middle Ages, during World War Il, Tang Dynasty... 4. Seasonal time nodes: early spring, midsummer, autumn equinox, early winter, severe winter...
Where Environment: Environment refers to the background or surrounding physical space where the main subject is located, providing context and atmosphere for the scene. 1. Natural environments: a mountain stream, rainforest, desert, seashore, alpine snowfield... 2. City environments: a busy business district, peaceful suburb, ancient neighborhood, modern technology park, large shopping center.. 3. Indoor environments: a cozy living room, modern office space, luxurious restaurant, cozy small bedroom, classical library... 4. Special environments: an intense battlefield, ancient palace, futuristic technology city, magical forest, western cowboy town...
Why Why is it in the picture? What is it doing? 1. Specific actions: Clearly describe the specific action that the subject is performing, such as reading a book, playing the piano, painting, drinking coffee, repairing a bicycle... 2. Interactive behaviors: Describe the interactive behaviors of the subject with other people or objects, such as talking with friends, feeding pets, dancing, playing music together, making a phone call... 3. Emotional expressions: Describe the emotional state or expression of the subject when performing an action, such as smiling and looking into the distance, furrowing one’s brows in thought, laughing, crying, being surprised... 4. Continuous activities: Describe a continuous activity that the subject is engaged in, such as running in the park, camping, picnicking, fishing, riding a bicycle...
How Scene Detail Description: A detailed and specific textual description of the specific elements and visual effects in the image. 1. Composition: Describe the layout and arrangement of elements within the image, such as golden ratio composition, diagonal composition, triangular composition... 2. Perspective: Describe the viewpoint and shooting angle of the image, such as bird's-eye view, looking up, eye level... 3. Artistic style/movement: Describe the artistic style or movement of the image, such as impressionism, realism, cyberpunk... 4. Color tone: Describe the overall color tone and color scheme of the image, such as cool tones, warm tones, high-saturation tones...5. Lighting and shadow effects: Describe the lighting and shadow effects in the image, such as soft light, strong shadows, gentle morning light... 6. Texture: Describe the surface texture of objects in the image, such as smooth, rough, furry, silky smooth... 7. Detailed elements: Describe the small elements or additional details in the image, such as decorations, background elements, exquisite patterns...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment