import os from huggingface_hub import InferenceClient from feifeilib.feifeiprompt import feifeiprompt from feifeilib.feifeisharpened import feifeisharpened client = InferenceClient("black-forest-labs/FLUX.1-dev", token=os.getenv('HF_TOKEN')) client.headers["x-use-cache"] = "0" def feifeifluxapi(randomize_seed,seed,prompt,quality_select,sharpened_select, styles_Radio,FooocusExpansion_select,height=1152,width=896,guidance_scale=3.5,num_strength=0.35): prompt,generator = feifeiprompt(randomize_seed,seed,prompt,quality_select,styles_Radio,FooocusExpansion_select) image = client.text_to_image( prompt=prompt, height=height, width=width, guidance_scale=guidance_scale ) if sharpened_select: feifeisharpened(image,num_strength) return image