Text-to-image generation.
Output types
:blob(default) — raw image bytes:data_url— base64 data URL string:url— direct CDN URL (if provider supports it):json— full JSON response
Example
{:ok, image_bytes} = HuggingfaceClient.text_to_image(client, %{
model: "stabilityai/stable-diffusion-2",
inputs: "a picture of a cat",
parameters: %{negative_prompt: "blurry"}
})
File.write!("cat.jpg", image_bytes)
Summary
Functions
Runs the text-to-image task.
Functions
@spec run(HuggingfaceClient.Client.t(), map()) :: {:ok, term()} | {:error, Exception.t()}
Runs the text-to-image task.
Returns {:ok, result} or {:error, exception}.