Skip to content

Latest commit

 

History

History
57 lines (41 loc) · 14.8 KB

File metadata and controls

57 lines (41 loc) · 14.8 KB

Image

(container.image)

Overview

Available Operations

generate

Given a description, the model generates image.

Example Usage

import os

from friendli import SyncFriendli

with SyncFriendli(
    token=os.getenv("FRIENDLI_TOKEN", ""),
) as friendli:
    res = friendli.container.image.generate(
        guidance_scale=3.5,
        num_inference_steps=10,
        prompt="An orange Lamborghini driving down a hill road at night with a beautiful ocean view in the background.",
        model="(adapter-route)",
        response_format="jpeg",
    )

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
guidance_scale float ✔️ Adjusts the alignment of the generated image with the input prompt. Higher values (e.g., 8-10) make the output more faithful to the prompt, while lower values (e.g., 1-5) encourage more creative freedom. This parameter may be irrelevant for certain models, such as FLUX.Schnell.
num_inference_steps int ✔️ The number of inference steps to use during image generation. Supported range: [1, 50].
prompt str ✔️ A text description of the desired image.
model OptionalNullable[str] Routes the request to a specific adapter. (adapter-route)
response_format OptionalNullable[models.ContainerImageGenerationBodyResponseFormat] The format in which the generated image will be returned. One of raw and jpeg.
seed OptionalNullable[int] The seed to use for image generation.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.
server_url Optional[str] An optional server URL to use. http://localhost:8080

Response

models.ContainerImageGenerateSuccess

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*