File size: 670 Bytes
372d102
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# from litellm import completion
# from openai import OpenAI

# client = OpenAI(
#   base_url="http://192.168.1.7:1337",

#   api_key="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",

# )

# completion = client.chat.completions.create(

#   model="google/gemini-2.0-flash-001",

#   messages= [

#     { "role": "user", "content": "What's the weather like in London?" }

#   ],


# )
# print(completion.choices[0].message)

from g4f.client import Client

client = Client()
response = client.images.generate(
    model="flux",
    prompt="a white siamese cat",
    response_format="url"
)

print(f"Generated image URL: {response.data[0].url}")