Spaces:
Running
on
Zero
Running
on
Zero
fallenshock
commited on
Commit
•
d4ee1f3
1
Parent(s):
400fefc
oauth 3
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ import torch
|
|
3 |
from diffusers import FluxPipeline, StableDiffusion3Pipeline
|
4 |
from PIL import Image
|
5 |
from typing import Optional
|
|
|
6 |
|
7 |
import random
|
8 |
import numpy as np
|
@@ -93,10 +94,10 @@ def FlowEditRun(
|
|
93 |
|
94 |
if model_type == 'FLUX':
|
95 |
# pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.float16)
|
96 |
-
pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.float16, token=
|
97 |
loaded_model = 'FLUX'
|
98 |
elif model_type == 'SD3':
|
99 |
-
pipe = StableDiffusion3Pipeline.from_pretrained("stabilityai/stable-diffusion-3-medium-diffusers", torch_dtype=torch.float16, token=
|
100 |
loaded_model = 'SD3'
|
101 |
else:
|
102 |
raise NotImplementedError(f"Model type {model_type} not implemented")
|
|
|
3 |
from diffusers import FluxPipeline, StableDiffusion3Pipeline
|
4 |
from PIL import Image
|
5 |
from typing import Optional
|
6 |
+
import os
|
7 |
|
8 |
import random
|
9 |
import numpy as np
|
|
|
94 |
|
95 |
if model_type == 'FLUX':
|
96 |
# pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.float16)
|
97 |
+
pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.float16, token=os.getenv('PRIV_TOKEN'))
|
98 |
loaded_model = 'FLUX'
|
99 |
elif model_type == 'SD3':
|
100 |
+
pipe = StableDiffusion3Pipeline.from_pretrained("stabilityai/stable-diffusion-3-medium-diffusers", torch_dtype=torch.float16, token=os.getenv('PRIV_TOKEN'))
|
101 |
loaded_model = 'SD3'
|
102 |
else:
|
103 |
raise NotImplementedError(f"Model type {model_type} not implemented")
|