File size: 412 Bytes
9037686
0d45a57
01fb166
31ef714
0d45a57
 
 
b3a5d68
9dd94af
dc6f4e4
9dd94af
 
 
 
82063dc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import os
from huggingface_hub import InferenceClient


client = InferenceClient("black-forest-labs/FLUX.1-dev", token=os.getenv('HF_TOKEN'))
client.headers["x-use-cache"] = "0"

def feifeifluxapi(prompt, height=1152, width=896, guidance_scale=3.5):
    image = client.text_to_image(
        prompt=prompt,
        height=height,
        width=width,
        guidance_scale=guidance_scale
    )
    return image