Spaces:
Running
on
Zero
Running
on
Zero
fallenshock
commited on
Commit
•
801b180
1
Parent(s):
0f741dd
Update app.py
Browse files
app.py
CHANGED
@@ -20,8 +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 |
-
pipe_sd3.to(device)
|
24 |
-
pipe_flux.to(device)
|
25 |
|
26 |
# scheduler = pipe.scheduler
|
27 |
# pipe = pipe.to(device)
|
@@ -97,15 +97,15 @@ def FlowEditRun(
|
|
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 |
|
107 |
scheduler = pipe.scheduler
|
108 |
-
pipe = pipe.to(device)
|
109 |
|
110 |
|
111 |
|
|
|
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.to(device)
|
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.to(device)
|
104 |
else:
|
105 |
raise NotImplementedError(f"Model type {model_type} not implemented")
|
106 |
|
107 |
scheduler = pipe.scheduler
|
108 |
+
# pipe = pipe.to(device)
|
109 |
|
110 |
|
111 |
|