multimodalart HF Staff commited on
Commit
5c5e329
·
verified ·
1 Parent(s): 16a1e1b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -3,9 +3,9 @@ import numpy as np
3
  import torch
4
  import spaces
5
  from diffusers import FluxPipeline, FluxTransformer2DModel
 
6
  from huggingface_hub import hf_hub_download
7
  from PIL import Image
8
- from diffusers.utils import export_to_gif
9
  import uuid
10
  import random
11
 
@@ -30,9 +30,6 @@ def split_image(input_image, num_splits=4):
30
  return output_images
31
 
32
  pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch_dtype)
33
- #pipe.load_lora_weights(hf_hub_download("ByteDance/Hyper-SD", "Hyper-FLUX.1-dev-16steps-lora.safetensors"))
34
- #pipe.fuse_lora(lora_scale=0.125)
35
- #pipe.to(device=device, dtype=torch_dtype)
36
 
37
  MAX_SEED = np.iinfo(np.int32).max
38
 
@@ -52,13 +49,16 @@ def infer(prompt, seed=1, randomize_seed=False, num_inference_steps=28, progress
52
  height=320,
53
  width=1280
54
  ).images[0]
 
55
  gif_name = f"{uuid.uuid4().hex}-flux.gif"
 
56
  export_to_gif(split_image(image, 4), gif_name, fps=4)
 
57
  return gif_name, image, seed
58
 
59
  examples = [
60
- "a cute cat raising holding a sign that reads \"Flux does Video?\"",
61
- "Will Smith eating pizza",
62
  "A flying saucer over the white house",
63
  ]
64
 
 
3
  import torch
4
  import spaces
5
  from diffusers import FluxPipeline, FluxTransformer2DModel
6
+ from diffusers.utils import export_to_gif
7
  from huggingface_hub import hf_hub_download
8
  from PIL import Image
 
9
  import uuid
10
  import random
11
 
 
30
  return output_images
31
 
32
  pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch_dtype)
 
 
 
33
 
34
  MAX_SEED = np.iinfo(np.int32).max
35
 
 
49
  height=320,
50
  width=1280
51
  ).images[0]
52
+
53
  gif_name = f"{uuid.uuid4().hex}-flux.gif"
54
+
55
  export_to_gif(split_image(image, 4), gif_name, fps=4)
56
+
57
  return gif_name, image, seed
58
 
59
  examples = [
60
+ "a cute cat raising a sign that reads \"Flux does Video?\"",
61
+ "Chris Rock eating pizza",
62
  "A flying saucer over the white house",
63
  ]
64