Spaces:
Running
Running
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -32,7 +32,7 @@ def init_pool():
|
|
32 |
_dynamo.config.suppress_errors = True
|
33 |
mp.set_start_method("fork", force=True)
|
34 |
|
35 |
-
#pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.bfloat16,
|
36 |
#pipe2 = StableDiffusionXLImg2ImgPipeline.from_pretrained("stabilityai/stable-diffusion-xl-refiner-1.0", torch_dtype=torch.float16, variant="fp16", use_safetensors=True).to(device)
|
37 |
#pipe2.unet = torch.compile(pipe2.unet, mode="reduce-overhead", fullgraph=True)
|
38 |
|
@@ -41,7 +41,7 @@ PIPE = None
|
|
41 |
def pipe_t2i():
|
42 |
global PIPE
|
43 |
if PIPE is None:
|
44 |
-
PIPE =
|
45 |
return PIPE
|
46 |
|
47 |
def pipe_i2i():
|
|
|
32 |
_dynamo.config.suppress_errors = True
|
33 |
mp.set_start_method("fork", force=True)
|
34 |
|
35 |
+
#pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.bfloat16, token=os.getenv("hf_token")).to(device)
|
36 |
#pipe2 = StableDiffusionXLImg2ImgPipeline.from_pretrained("stabilityai/stable-diffusion-xl-refiner-1.0", torch_dtype=torch.float16, variant="fp16", use_safetensors=True).to(device)
|
37 |
#pipe2.unet = torch.compile(pipe2.unet, mode="reduce-overhead", fullgraph=True)
|
38 |
|
|
|
41 |
def pipe_t2i():
|
42 |
global PIPE
|
43 |
if PIPE is None:
|
44 |
+
PIPE = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.bfloat16, token=os.getenv("hf_token"), device=-1)
|
45 |
return PIPE
|
46 |
|
47 |
def pipe_i2i():
|