· 4 min read · updated

My image model could already write alt text

Writing alt text in two languages was the slowest part of making my covers. The image model's text encoder could already do it on my PC, as long as I check every answer.

Printing machine

I make my blog covers on my own PC with an image model called Krea 2, and choose them in a small page I built. Choosing is quick. What slowed me down was the alt text: every cover needs it in English and Spanish. After dozens of covers, I was writing things like "Machine with buttons". That's true, but it doesn't help anyone who can't see the picture.

Each cover starts with a written description, so I wondered if the image model could write the alt text too. It can't, but part of it can.

The part that reads the prompt

An image model can't use words directly. First, a text encoder turns the prompt into numbers that guide the image. Older models often used encoders that could only do that. Krea 2 uses Qwen3-VL 4B, which is a full language model that can also look at images. To make images, it only has to read. It can still write.

The file was already on my disk, and ComfyUI, which runs the model, has a node called TextGenerateV2. This is the whole workflow:

ts
const workflow = {
	clip: { class_type: 'CLIPLoader', inputs: { clip_name: encoder, type: 'krea2' } },
	image: { class_type: 'SwarmLoadImageB64', inputs: { image_base64: image } },
	write: {
		class_type: 'TextGenerateV2',
		inputs: {
			clip: ['clip', 0],
			'images.image1': ['image', 0],
			prompt,
			max_length: 400,
			sampling_mode: 'off'
		}
	},
	show: { class_type: 'PreviewAny', inputs: { source: ['write', 0] } }
};

Each ['clip', 0] means "the first output of the node called clip". SwarmLoadImageB64 comes with SwarmUI, the app I use to run ComfyUI. With it, I can send the image in the request without saving another file. With sampling off, the model always picks its most likely next word, so the same question should get the same answer.

I didn't have to download anything, and my images never leave my PC. The first answer takes about 45 seconds while the encoder loads, then each one takes about 4. The image model isn't needed, so this uses about half as much extra memory as making an image.

What to ask

I tried three ways on six covers.

With only the image, the answers were vague. This one is for a machine where a funnel feeds cards into a crate:

The machine features interconnected components with labeled sections, including a "GLOB" unit and a "BUNDLE" container.

With the image and the description it was made from, the model knew what it was looking at:

A machine processes glass file cards through five stations: rack, cable fan, star-funnel, press, and bundle crate on a scale.

Asking for the Spanish in a second request made it worse, even with a list of words to use. A funnel became "funil", which isn't a Spanish word, and the file cards became "cartas", like playing cards or letters. Asking for both languages at once worked better.

I'd also put an example in the English prompt, "A sorting machine with…". All six answers started with "A sorting machine". None of my machines is one. A small model can easily copy an example instead of learning from it, so I took it out.

Let code write what it knows

Each cover has a title in big letters, and it belongs in the alt text. But my code already knows the title, so there's no reason to let a model misspell it. The model only describes the machine, and the code adds the rest:

ts
return {
	en: `${lines[0]} Its title says “${top} ${bottom}”.`,
	es: `${lines[1]} El título dice «${top} ${bottom}».`
};

The prompt also tells the model not to mention colours, because each theme changes the colour of the light. It doesn't always listen: one answer still mentioned "grey cylinders". If the answer isn't exactly two lines, my code shows an error instead of guessing which language is which.

It only makes suggestions

The description makes the answers better, but it also gives the model something to repeat. One description asked for two screens with dark page layouts. Krea drew two blank screens, and the alt text still said "two screens with dark layouts". The Spanish has small mistakes too, like "un palanca" instead of "una palanca".

That's why the button is called Write it for me and only fills in the form. The picture is right above the text, and I check it, fix it and save it myself. Wrong alt text can be worse than short alt text, because someone who can't see the picture can't tell it's wrong.

I still have to read every suggestion, but fixing a sentence is much easier than starting from nothing for the fiftieth time. Before you download another model, check what the ones you already have can do.