LangChain: langchain-veida
VeidaImageGenerator is a LangChain tool that turns a prompt into an image URL with
no API key and no account. It runs on the anonymous tier of
Veida AI, an unlimited free AI
image generator, so an agent can make pictures on a machine with nothing configured.
Install
pip install langchain-veida
Use it directly
from langchain_veida import VeidaImageGenerator
tool = VeidaImageGenerator()
url = tool.invoke({"prompt": "a paper boat on a calm lake at sunrise, soft light", "aspect_ratio": "16:9"})
print(url) # https://cdn.veida.ai/uploads/....webp
Give it to an agent
from langchain.agents import create_agent
from langchain_veida import VeidaImageGenerator
agent = create_agent("openai:gpt-5-mini", tools=[VeidaImageGenerator()])
agent.invoke({"messages": [{"role": "user", "content": "Make a 16:9 banner of a lighthouse at dusk"}]})
Inputs
| Field | Type | Default | Meaning |
|---|---|---|---|
prompt |
str | required | What the picture should show: subject, light, medium, framing |
aspect_ratio |
str | "1:1" |
One of 1:1, 16:9, 9:16, 4:3, 3:4 |
The tool returns the image URL as a string. When the free allowance for the machine is spent, or the content filter declines a prompt, it returns that as text instead of raising, so the agent can wait or reword.
Free tier
Each call mints a fresh anonymous id worth one run on Veida AI Image v1; one machine gets about seven a day (see Limits). Signing in on veida.ai makes v1 unlimited and opens the larger models, such as GPT Image 2 for pictures that carry readable text.
Source: github.com/hanshs474/langchain-veida ยท PyPI: langchain-veida