Continuous Angular Control in Text-to-Image Generation via Geometric Token Encoding

Furkan Güzelant1 Basavaraj Sunagad2 Aysegul Dundar1 Adam Kortylewski3

1 Bilkent University, Turkey

2 CISPA Helmholtz Center for Information Security, Germany

3 University of Freiburg, Germany

WACV 2027

A unified geometric token encoding framework for controlling clock times and fractional portions in text-to-image diffusion models.

Comparison of clock and fraction control results.

Overview examples comparing precise clock-time and fraction control across several image generators. Each column uses a fixed target value and prompt; the bottom row shows our geometry-token model.

Abstract

Current text-to-image models often fail when a prompt requires an object to encode a precise continuous quantity, such as an analog clock showing a specific time or a circular object showing a specific fraction. We represent these quantities as periodic geometric features, map them to CLIP-compatible token embeddings, and inject them before the text encoder.

During training, bounding boxes provide privileged spatial guidance for the geometric tokens, while Stochastic Localization Relaxation (SLR) varies the localization supervision from component-level to object-level to unconstrained attention.

Method

Geometric token encoding method.
Continuous quantities are encoded as geometric tokens and injected into the text conditioning stream.

Target values are converted to periodic angle features, projected into role-specific token embeddings, and inserted into the prompt before the frozen text encoder.

Bounding-box dropout training design.
Component-level bbox guidance is used only during training; inference is bbox-free.

Training alternates between component-level, object-level, and unconstrained attention localization so the model learns to use privileged boxes without requiring them at test time.

Periodic encoding and geometric tokens

We represent clock-hand angles and circular-sector boundaries using periodic sine-cosine features, enabling smooth control across the angular range. A lightweight projection network maps these features to role-specific tokens, which are inserted into the prompt before the frozen text encoder. Only the projection network and diffusion LoRA adapters are trained, separately for clocks and fractions.

Stochastic Localization Relaxation

During training, SLR varies attention guidance between component-level boxes (55%), a shared object box (30%), and unconstrained attention (15%). This grounds each token in the correct visual region while teaching the model to operate without spatial guidance. Inference requires only the text prompt and target value.

Hand-swap preference loss

For clocks, a second training phase reduces confusion between hour- and minute-hand roles. We compare correct token assignments with a hard negative formed by swapping the two hand embeddings under identical noise conditions. Alongside the diffusion loss, the preference loss rewards greater improvement over a fixed reference for the correct assignment. This additional objective is used only for clocks.

Results

~70% clock two-hand accuracy within 6 degrees
~84% fraction transfer accuracy on unseen object categories
Generalization figure.
Generalization across continuous values and held-out settings.

These examples evaluate whether the learned geometric tokens remain controllable across target values and object appearances beyond the exact training samples.

Fraction baseline comparison on fruit tart and waffle prompts.
Fraction model comparison on a non-pizza object.

We compare zero-shot fraction generations from SD 2.1, SDXL, SD 3.5, and Flux.1 against our geometric-token model using matched fruit tart and waffle prompts while varying only the target fraction. The baseline models often preserve realistic appearance, but the requested visible portion is not reliably controlled.

Clock Control Videos

For each visualization, the text prompt and random seed are fixed while the target time is swept from 00:00 to 11:59 in 1-minute steps. This isolates the effect of changing only the geometric token values.

Black analog clock
Brass Art Deco table clock
Green marble luxury clock
Metal analog clock

Fraction Control Videos

For each visualization, the object prompt and random seed are fixed while the target sector angle is swept from 010 to 350 degrees. The videos show how the generated portion changes as only the fraction geometry changes.

Berry waffle
Burger patty
Cake tiramisu
Cheese wheel
Cherry pie wood
Chocolate waffle
Cinnamon roll
Donut glazed
Mosaic transfer
Orange slice
Pancake ceramic plate
Pepperoni pizza marble
Pizza four-cheese
Pizza margherita
Pizza veggie
Quesadilla
Quiche lorraine plate
Roulette wheel
Stained glass rose window
Waffle
Watermelon round

Additional Qualitative Results

Unseen fraction qualitative outputs from our model.
Evaluation-selected qualitative outputs from our model on the 14-object unseen-fraction set.

The targets in this grid use fraction angles that are not part of the 5-degree training grid, illustrating interpolation behavior on held-out fraction values.

Scene generation examples.
Clock and fraction control in richer scenes.

These scene-level examples test whether the same geometric-token controls remain usable when the controlled object appears with additional surrounding context.