nroggendorff commited on
Commit
21ad34f
·
verified ·
1 Parent(s): 7c4e359

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -2,14 +2,14 @@ import gradio as gr
2
  import spaces
3
 
4
  import torch
5
- from diffusers import DiffusionPipeline
6
 
7
- pipeline = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-dev").to("cuda")
8
- pipeline.enable_model_cpu_offload()
9
 
10
- @spaces.GPU(duration=120)
11
  def generate(prompt, negative_prompt, width, height, sample_steps):
12
- return pipeline(prompt=f"{prompt} DO NOT INCLUDE {negative_prompt} FOR ANY REASON", width=width, height=height, num_inference_steps=sample_steps, generator=torch.Generator("cpu").manual_seed(127), guidance_scale=7).images[0]
13
 
14
  with gr.Blocks() as interface:
15
  with gr.Column():
 
2
  import spaces
3
 
4
  import torch
5
+ from diffusers import FluxPipeline
6
 
7
+ pipeline = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev").to("cuda")
8
+ #pipeline.enable_model_cpu_offload()
9
 
10
+ @spaces.GPU(duration=190)
11
  def generate(prompt, negative_prompt, width, height, sample_steps):
12
+ return pipeline(prompt=f"{prompt}\nDO NOT INCLUDE {negative_prompt} FOR ANY REASON", width=width, height=height, num_inference_steps=sample_steps, generator=torch.Generator("cpu").manual_seed(127), guidance_scale=7).images[0]
13
 
14
  with gr.Blocks() as interface:
15
  with gr.Column():