Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,7 +9,13 @@ from safetensors.torch import load_file
|
|
| 9 |
from omegaconf import OmegaConf
|
| 10 |
|
| 11 |
from image_datasets.dataset import image_resize
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
from src.flux.xflux_pipeline import XFluxSampler
|
| 14 |
args = OmegaConf.load("inference_configs/inference.yaml")
|
| 15 |
# is_schnell = args.model_name == "flux-schnell"
|
|
|
|
| 9 |
from omegaconf import OmegaConf
|
| 10 |
|
| 11 |
from image_datasets.dataset import image_resize
|
| 12 |
+
def tensor_to_pil_image(in_image):
|
| 13 |
+
tensor = in_image.squeeze(0)
|
| 14 |
+
tensor = (tensor + 1) / 2
|
| 15 |
+
tensor = tensor * 255
|
| 16 |
+
numpy_array = tensor.permute(1, 2, 0).byte().numpy()
|
| 17 |
+
pil_image = Image.fromarray(numpy_array)
|
| 18 |
+
return pil_image
|
| 19 |
from src.flux.xflux_pipeline import XFluxSampler
|
| 20 |
args = OmegaConf.load("inference_configs/inference.yaml")
|
| 21 |
# is_schnell = args.model_name == "flux-schnell"
|