Yaron Koresh commited on
Commit
a8a8725
·
verified ·
1 Parent(s): 9378132

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -7
app.py CHANGED
@@ -40,16 +40,12 @@ def init_pool(_1,_2):
40
  #pipe2.unet = torch.compile(pipe2.unet, mode="reduce-overhead", fullgraph=True)
41
 
42
  def pipe_t2i():
43
- global PIPE
44
- if PIPE is None:
45
- PIPE = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.bfloat16, token=os.getenv("hf_token"), device=-1)
46
  return PIPE
47
 
48
  def pipe_i2i():
49
- global PIPE
50
- if PIPE is None:
51
- PIPE = pipeline("image-to-image", model="stabilityai/stable-diffusion-xl-refiner-1.0", tokenizer="stabilityai/stable-diffusion-xl-refiner-1.0", torch_dtype=torch.float16, device=-1, variant="fp16", use_safetensors=True)
52
- PIPE.unet = torch.compile(PIPE.unet, mode="reduce-overhead", fullgraph=True)
53
  return PIPE
54
 
55
  pp1=pipe_t2i()
 
40
  #pipe2.unet = torch.compile(pipe2.unet, mode="reduce-overhead", fullgraph=True)
41
 
42
  def pipe_t2i():
43
+ PIPE = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.bfloat16, token=os.getenv("hf_token"), device=-1)
 
 
44
  return PIPE
45
 
46
  def pipe_i2i():
47
+ PIPE = pipeline("image-to-image", model="stabilityai/stable-diffusion-xl-refiner-1.0", tokenizer="stabilityai/stable-diffusion-xl-refiner-1.0", torch_dtype=torch.float16, device=-1, variant="fp16", use_safetensors=True)
48
+ PIPE.unet = torch.compile(PIPE.unet, mode="reduce-overhead", fullgraph=True)
 
 
49
  return PIPE
50
 
51
  pp1=pipe_t2i()