Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -4,14 +4,13 @@ import spaces
|
|
4 |
import torch
|
5 |
import random
|
6 |
from PIL import Image
|
7 |
-
|
8 |
-
from diffusers import
|
9 |
from diffusers.utils import load_image
|
10 |
-
from huggingface_hub import hf_hub_download
|
11 |
|
12 |
MAX_SEED = np.iinfo(np.int32).max
|
13 |
|
14 |
-
pipe = FluxKontextPipeline.from_pretrained("black-forest-labs/FLUX.1-Kontext-dev",
|
15 |
|
16 |
@spaces.GPU
|
17 |
def infer(input_image, prompt, seed=42, randomize_seed=False, guidance_scale=2.5, steps=28, progress=gr.Progress(track_tqdm=True)):
|
|
|
4 |
import torch
|
5 |
import random
|
6 |
from PIL import Image
|
7 |
+
|
8 |
+
from diffusers import FluxKontextPipeline
|
9 |
from diffusers.utils import load_image
|
|
|
10 |
|
11 |
MAX_SEED = np.iinfo(np.int32).max
|
12 |
|
13 |
+
pipe = FluxKontextPipeline.from_pretrained("black-forest-labs/FLUX.1-Kontext-dev", torch_dtype=torch.bfloat16).to("cuda")
|
14 |
|
15 |
@spaces.GPU
|
16 |
def infer(input_image, prompt, seed=42, randomize_seed=False, guidance_scale=2.5, steps=28, progress=gr.Progress(track_tqdm=True)):
|