gliph: write a line in a hand
The model writes Arabic-script text in the hand of a few reference lines. It runs on your device.
Choose a hand.
A style downloads when you choose it.Zero-shot: the model reads your lines, but it is not adapted to them.
Upload one photo of 1 to 6 lines, or several images of one line each. Type the text of each line.
Type the text.
One line: about 5 to 10 words.The model writes the text in the hand.
How this works
- Your browser downloads the model once. The browser keeps it for the next visit.
- The typesetter sets your text in a printed face (Amiri). This line gives the letters and their order.
- The style encoder reads the reference lines. It gives one style code for the hand.
- The model starts from noise. It removes the noise in a number of steps, guided by the text and the style.
- The model writes some draws of the line, each from different noise.
- The critic, a reader trained on KHATT, reads each draw. The page shows the draw with the fewest reading errors (the lowest CER) first.
- The result is an image of one line, 64 px high. The page shows it at up to 2× its size, and always the whole line.
The model runs on your device: on your graphics card with WebGPU, or on your processor (CPU). The server sends files only. It does not compute and it does not receive your images or your text.
The gallery styles are adapted offline. A GPU fine-tunes the model for 300 steps on each style's reference lines. The page downloads each adaptation as a small change to the base model.
Your own lines are zero-shot. The model reads them, but it is not adapted to them. So the result is less close to your hand than a gallery style is to its hand.
The model is trained on KHATT, a corpus of Arabic handwriting by about 1,000 writers. It knows Arabic letters best. Letters that are not in Arabic (for example Jawi or Persian letters) can come out wrong.
A line on the CPU takes some minutes. Fewer steps make it faster and a little less clean.