IB COMPUTER SCIENCE | 2027 CASE STUDY | SL & HL

02.2 Conditional generation: labels, sketches and segmentation maps

Explain how class labels, sketches and segmentation maps guide image generation, compare their control and limitations, and apply them to Visionary Studios.

Understand the technology

Choose the guidance that fits the requirement.

For May and November 2027. This introductory lesson is shared SL and HL content.

01 | GIVE THE GENERATOR SOMETHING TO FOLLOW

A designer knows where a lake, mountains and an explorer should appear, but a text prompt keeps producing the wrong layout. Instead of describing every position in words, the designer could provide visual guidance.

Conditional generation produces content guided by specified information, called a condition . That information might be text, a category label, a sketch or a segmentation map. It influences the output while the trained model supplies learned visual patterns.

For Visionary Studios, different conditions offer different kinds of creative control. They guide generation; they do not guarantee that every requirement will be followed exactly.

02 | CONDITIONAL DOES NOT MEAN AN IF STATEMENT

In programming, you may have used a condition in an IF statement. Here, the word has a different emphasis: information is supplied to guide which outputs the model produces.

A label such as “landscape” can guide the category. A sketch can guide outlines and arrangement. A map can identify which regions should contain sky, mountains or water.

The model must support the chosen type of guidance. Uploading an arbitrary drawing to a system that only accepts text does not automatically give it sketch-based control.

03 | TEXT-TO-IMAGE IS CONDITIONAL TOO

The previous lesson used a description to guide an image. That is conditional generation because text supplies information about the desired result.

The booklet discusses text-to-image and other conditional techniques in separate paragraphs to highlight their uses. They are not mutually exclusive technical categories.

A system can also combine conditions, such as text describing an illustration style and a sketch specifying layout. Whether and how those inputs can be combined depends on the particular system.

04 | CLASS LABELS: CHOOSE A CATEGORY

A class label identifies a category, such as animal, landscape or vehicle. In class-conditional generation, the label tells the model which category of content to generate.

For example, selecting “landscape” could guide a compatible model towards landscapes rather than portraits. The label does not specify the position of every mountain or the colour of every tree.

Categories must be meaningful to the trained system. A model trained with a particular set of labels cannot be assumed to support any new category name a designer invents.

05 | GENERATING A CLASS IS DIFFERENT FROM CLASSIFYING

Classification starts with an input and predicts its category. Class-conditional generation starts with category guidance and produces content associated with that category.

Classification

Existing image → predicted label “landscape”.

Class-conditional generation

Label “landscape” + generative model → candidate landscape image.

Both may involve class labels, but the direction of the task is different. Selecting a label does not simply ask a classifier to draw its answer.

06 | LABELS GIVE BROAD CONTROL

A category can be enough when the studio wants many possible animal designs or landscape concepts. Leaving layout and detail open can support exploration.

However, a label such as “landscape” does not communicate the fictional explorer campaign’s right-hand character position or left-hand headline space. More specific guidance would be needed for that brief.

Choose guidance according to what must be controlled. Broad categories are useful for broad selection; they are not a substitute for a precise spatial plan.

07 | SKETCHES: SHOW THE ARRANGEMENT

A sketch is a simplified drawing that communicates shapes, outlines and placement. It may indicate a mountain ridge, the lake boundary and the position of a character without showing finished textures or lighting.

A compatible sketch-conditioned generator can use those visual structures to guide a more detailed image. The sketch supplies some decisions; the model generates further content.

This can help Visionary Studios when an art director already knows the arrangement. However, unclear lines can be interpreted differently, and the generated details still need review.

08 | READ A SIMPLE SKETCH

Intended headline area
Sketch: lines indicate boundaries and a figure; the dashed box is a designer annotation for headline space.

In this schematic teaching sketch, the ridge lines communicate mountain shapes, the horizontal line suggests the lake edge and the figure indicates the subject’s position. The open left-hand area communicates a layout intention.

The sketch does not fully define materials, colours or artistic treatment. A text prompt could supply those details in a system that supports both inputs. This drawing is an explanatory diagram, not output from an image generator.

09 | A SKETCH IS NOT JUST A FINISHED IMAGE IN BLACK AND WHITE

A sketch usually omits much of the appearance information found in a photograph. It may show boundaries but not tell the model whether a region is rock, water or fabric.

A line could represent a mountain edge, a road or an object boundary depending on context. Text or other conditions may help resolve ambiguity.

A black-and-white photograph still contains shading and texture. It is therefore different from a sparse outline sketch, even though both can lack colour. The next lesson examines image-to-image translation more broadly.

10 | SEGMENTATION MAPS: NAME THE REGIONS

A segmentation map assigns categories to regions or pixels. Instead of merely drawing a boundary, it indicates what an area represents: sky, mountain, water or person.

A teaching map may display each category using a different colour. The colours act as a legend. A blue region marked “sky” does not necessarily require the final sky to use that exact shade of blue.

The representation supplied to a model may use class IDs or another encoding. The supported categories and encoding must match the system; there is no universal colour key shared by all generators.

11 | READ THE MAP AND ITS LEGEND

Sky Mountain Water Person
Map legend: pale blue = sky; purple = mountain; teal = water; pink = person. Colours encode categories in this example.

The coloured areas specify semantic regions: the map associates each area with a meaning. The person region is on the right, while sky, mountains and water establish the wider arrangement.

The map is deliberately simplified. It does not supply realistic reflections, clothing textures or detailed facial features. The model must produce appearance consistent with the conditions and what it learned.

This is a hand-authored schematic, not an AI-generated result. Its legend belongs to this example, not to every segmentation system.

12 | SEMANTIC REGIONS AND INDIVIDUAL OBJECTS

Semantic segmentation assigns category labels to pixels or regions. If two people are both marked “person”, their category alone does not give them separate identities.

Instance segmentation additionally distinguishes individual objects within a category, such as person 1 and person 2. This is useful supporting vocabulary, although the booklet’s core term is segmentation map.

Do not assume that a region labelled “person” identifies a particular recurring character. Spatial category guidance and character identity are different requirements.

13 | COMPARE WHAT EACH INPUT COMMUNICATES

Different conditions answer different creative questions
Condition Communicates Leaves less specified
Class label A broad category such as landscape Exact layout, identity and appearance
Sketch Outlines, rough shapes and placement Region meanings, textures and colours unless otherwise indicated
Segmentation map Where named categories occur Detailed appearance and individual identity
Text prompt A description of subject, style and other requested qualities Exact spatial compliance is not guaranteed

These are useful general distinctions, not absolute limits for every application. Capabilities depend on training and the supported inputs.

14 | COMBINE CONDITIONS CAREFULLY

For the fictional explorer brief, a sketch might specify the pose, a segmentation map might specify the scene regions and text might request an editorial illustration in a restrained palette.

More inputs do not automatically improve the result. If the text asks for the explorer on the left while the map places the person on the right, the guidance conflicts.

Review the conditions together before generating. If the output fails, investigate the input representation and conflicts rather than simply adding more instructions. The way a system balances conditions depends on its implementation and settings.

15 | PREPARING AN INPUT HAS A COST

Sketches and maps take time to create. They may reduce repeated generation or manual correction, but the studio should measure the complete workflow rather than assume stronger control is always faster.

A rough label may be sufficient for early exploration. A carefully prepared map may be worthwhile for a tightly specified layout. The appropriate choice depends on the value of control at that stage.

Preparing a new condition for an existing compatible model is normally input preparation, not retraining. Training a model to accept a new kind of condition is a separate technical task.

16 | TEST WHETHER THE GUIDANCE HELPED

Agree criteria before comparing approaches. For a layout task, reviewers could check whether the character occupies the intended area, whether important region boundaries are followed and whether the image still meets style and quality requirements.

Record preparation time, generation settings, repeated outputs and editing effort. A sketch-based workflow should not be declared better solely because one attractive image happened to follow the layout.

Also inspect what the conditions do not guarantee. A person region in the right place does not prove consistent facial features, fair representation or appropriate training data.

17 | APPLY IT TO VISIONARY STUDIOS

Visionary Studios could use class labels for broad concept exploration and visual conditions for projects needing more spatial control. These are proposed uses, not claims about tools the company has already selected.

Explain: A segmentation map could help the studio communicate where the character and landscape regions belong because each region is assigned a category. However, the map does not fully specify the character’s appearance, therefore designers must also check identity, style and detail.

A justified recommendation connects the chosen condition to a requirement, identifies its limitations and describes how to evaluate the result.

18 | DESIGN A CONDITION ON PAPER

Draw a simple campaign layout and produce two versions: an outline sketch and a segmentation map with a legend. Label the intended subject position and any space reserved for text. Explain what each version communicates and what it leaves unspecified.

Then write one matching text prompt and identify a possible conflict that you should avoid. You do not need an account or image generator to complete the task.

Reveal a possible response

The sketch shows a mountain ridge, lake edge and a character on the right. The map marks sky, mountain, water and person regions with a stated legend. Text requests an editorial illustration of an explorer in a green jacket. The map guides category placement, while the text adds appearance information. A prompt placing the explorer on the left would conflict with the map.

Review repeated outputs for layout, character appearance and style, and include input preparation and editing time in the comparison.

Read alongside the conditional generation section of the official 2027 booklet. Diagrams and the explorer campaign here are independent teaching examples.

CHECK YOUR UNDERSTANDING | LABEL, SKETCH OR SEGMENTATION MAP?

Identify the type of guidance described. Focus on categories, outline structure or labelled regions.