Spaces:
Running
on
Zero
Running
on
Zero
fallenshock
commited on
Commit
•
0f741dd
1
Parent(s):
c46f4d1
Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,8 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
20 |
|
21 |
pipe_sd3 = StableDiffusion3Pipeline.from_pretrained("stabilityai/stable-diffusion-3-medium-diffusers", torch_dtype=torch.float16, token=os.getenv('HF_ACCESS_TOK'))
|
22 |
pipe_flux = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.float16, token=os.getenv('HF_ACCESS_TOK'))
|
23 |
-
|
|
|
24 |
|
25 |
# scheduler = pipe.scheduler
|
26 |
# pipe = pipe.to(device)
|
@@ -96,10 +97,10 @@ def FlowEditRun(
|
|
96 |
|
97 |
if model_type == 'FLUX':
|
98 |
# pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.float16, token=os.getenv('HF_ACCESS_TOK'))
|
99 |
-
pipe =
|
100 |
elif model_type == 'SD3':
|
101 |
# pipe = StableDiffusion3Pipeline.from_pretrained("stabilityai/stable-diffusion-3-medium-diffusers", torch_dtype=torch.float16, token=os.getenv('HF_ACCESS_TOK'))
|
102 |
-
pipe =
|
103 |
else:
|
104 |
raise NotImplementedError(f"Model type {model_type} not implemented")
|
105 |
|
|
|
20 |
|
21 |
pipe_sd3 = StableDiffusion3Pipeline.from_pretrained("stabilityai/stable-diffusion-3-medium-diffusers", torch_dtype=torch.float16, token=os.getenv('HF_ACCESS_TOK'))
|
22 |
pipe_flux = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.float16, token=os.getenv('HF_ACCESS_TOK'))
|
23 |
+
pipe_sd3.to(device)
|
24 |
+
pipe_flux.to(device)
|
25 |
|
26 |
# scheduler = pipe.scheduler
|
27 |
# pipe = pipe.to(device)
|
|
|
97 |
|
98 |
if model_type == 'FLUX':
|
99 |
# pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.float16, token=os.getenv('HF_ACCESS_TOK'))
|
100 |
+
pipe = pipe_flux
|
101 |
elif model_type == 'SD3':
|
102 |
# pipe = StableDiffusion3Pipeline.from_pretrained("stabilityai/stable-diffusion-3-medium-diffusers", torch_dtype=torch.float16, token=os.getenv('HF_ACCESS_TOK'))
|
103 |
+
pipe = pipe_sd3
|
104 |
else:
|
105 |
raise NotImplementedError(f"Model type {model_type} not implemented")
|
106 |
|