Spaces:
Runtime error
Runtime error
rizavelioglu commited on
Commit ·
2bed2d3
1
Parent(s): eea9702
fix: loading Flux2-TAE
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import spaces
|
| 2 |
import gradio as gr
|
| 3 |
import torch
|
| 4 |
-
from diffusers import AutoencoderKL, AutoencoderDC
|
| 5 |
from diffusers.utils.remote_utils import remote_decode
|
| 6 |
import torchvision.transforms.v2 as transforms
|
| 7 |
from torchvision.io import read_image
|
|
@@ -66,7 +66,7 @@ class VAETester:
|
|
| 66 |
# "dc-ae-f32c32-sana-1.0": AutoencoderDC.from_pretrained("mit-han-lab/dc-ae-f32c32-sana-1.0-diffusers").to(self.device),
|
| 67 |
"FLUX.1-Kontext": AutoencoderKL.from_pretrained("black-forest-labs/FLUX.1-Kontext-dev", subfolder="vae").to(self.device),
|
| 68 |
"FLUX.2": AutoencoderKL.from_pretrained("black-forest-labs/FLUX.2-dev", subfolder="vae").to(self.device),
|
| 69 |
-
"FLUX.2-TinyAutoEncoder":
|
| 70 |
}
|
| 71 |
# Define the desired order of models
|
| 72 |
order = [
|
|
|
|
| 1 |
import spaces
|
| 2 |
import gradio as gr
|
| 3 |
import torch
|
| 4 |
+
from diffusers import AutoencoderKL, AutoencoderDC, AutoModel
|
| 5 |
from diffusers.utils.remote_utils import remote_decode
|
| 6 |
import torchvision.transforms.v2 as transforms
|
| 7 |
from torchvision.io import read_image
|
|
|
|
| 66 |
# "dc-ae-f32c32-sana-1.0": AutoencoderDC.from_pretrained("mit-han-lab/dc-ae-f32c32-sana-1.0-diffusers").to(self.device),
|
| 67 |
"FLUX.1-Kontext": AutoencoderKL.from_pretrained("black-forest-labs/FLUX.1-Kontext-dev", subfolder="vae").to(self.device),
|
| 68 |
"FLUX.2": AutoencoderKL.from_pretrained("black-forest-labs/FLUX.2-dev", subfolder="vae").to(self.device),
|
| 69 |
+
"FLUX.2-TinyAutoEncoder": AutoModel.from_pretrained("fal/FLUX.2-Tiny-AutoEncoder", trust_remote_code=True).to(self.device),
|
| 70 |
}
|
| 71 |
# Define the desired order of models
|
| 72 |
order = [
|