File size: 447 Bytes
9037686
3cb8927
01fb166
3cb8927
 
0d45a57
b3a5d68
3cb8927
d22b2b8
3cb8927
cfb87a3
 
96ba1d5
9dd94af
cfb87a3
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("aifeifei798/feifei-flux-lora-v1.1", token=os.getenv('HF_TOKEN'))
client.headers["x-use-cache"] = "0"

def feifeifluxapi(prompt, height=1152, width=896, guidance_scale=3.5):
    # output is a PIL.Image object
    prompt = prompt.replace('\n', ' ')
    result = client.text_to_image(
    		prompt=prompt,
    		width=width,
    		height=height
    )
    return result