Spaces:
Sleeping
Sleeping
Commit
·
5ce6559
1
Parent(s):
e777edc
Updates
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import logging
|
|
5 |
import torch
|
6 |
from PIL import Image
|
7 |
import spaces
|
8 |
-
from diffusers import
|
9 |
from live_preview_helpers import calculate_shift, retrieve_timesteps, flux_pipe_call_that_returns_an_iterable_of_images
|
10 |
from diffusers.utils import load_image
|
11 |
from huggingface_hub import hf_hub_download, HfFileSystem, ModelCard, snapshot_download
|
@@ -25,7 +25,16 @@ base_model = "black-forest-labs/FLUX.1-dev"
|
|
25 |
taef1 = AutoencoderTiny.from_pretrained("madebyollin/taef1", torch_dtype=dtype).to(device)
|
26 |
good_vae = AutoencoderKL.from_pretrained(base_model, subfolder="vae", torch_dtype=dtype).to(device)
|
27 |
pipe = DiffusionPipeline.from_pretrained(base_model, torch_dtype=dtype, vae=taef1).to(device)
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
MAX_SEED = 2**32-1
|
31 |
|
|
|
5 |
import torch
|
6 |
from PIL import Image
|
7 |
import spaces
|
8 |
+
from diffusers import FluxImg2ImgPipeline
|
9 |
from live_preview_helpers import calculate_shift, retrieve_timesteps, flux_pipe_call_that_returns_an_iterable_of_images
|
10 |
from diffusers.utils import load_image
|
11 |
from huggingface_hub import hf_hub_download, HfFileSystem, ModelCard, snapshot_download
|
|
|
25 |
taef1 = AutoencoderTiny.from_pretrained("madebyollin/taef1", torch_dtype=dtype).to(device)
|
26 |
good_vae = AutoencoderKL.from_pretrained(base_model, subfolder="vae", torch_dtype=dtype).to(device)
|
27 |
pipe = DiffusionPipeline.from_pretrained(base_model, torch_dtype=dtype, vae=taef1).to(device)
|
28 |
+
ipe_i2i = FluxImg2ImgPipeline.from_pretrained(
|
29 |
+
base_model,
|
30 |
+
vae=good_vae,
|
31 |
+
transformer=pipe.transformer,
|
32 |
+
text_encoder=pipe.text_encoder,
|
33 |
+
tokenizer=pipe.tokenizer,
|
34 |
+
text_encoder_2=pipe.text_encoder_2,
|
35 |
+
tokenizer_2=pipe.tokenizer_2,
|
36 |
+
torch_dtype=dtype
|
37 |
+
)
|
38 |
|
39 |
MAX_SEED = 2**32-1
|
40 |
|