Spaces:
Paused
Paused
Delete app.py
Browse files12345678910111213141516171819202122232425262728import gradio as grimport numpy as npimport randomimport spacesimport torchfrom diffusers import DiffusionPipeline
dtype = torch.bfloat16device = "cuda" if torch.cuda.is_available() else "cpu"
pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=dtype).to(device)
MAX_SEED = np.iinfo(np.int32).maxWIDTH = 700HEIGHT = 900
@spaces.GPU()def infer(prompt, progress=gr.Progress(track_tqdm=True)): try: seed = random.randint(0, MAX_SEED) generator = torch.Generator().manual_seed(seed) image = pipe( prompt=prompt, width=WIDTH, height=HEIGHT, num_inference_steps=4, generator=generator,app.pyDeleted-28