AlekseyCalvin commited on
Commit
73ea1d1
·
verified ·
1 Parent(s): 8d1bd37

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -5,7 +5,7 @@ import logging
5
  import torch
6
  from PIL import Image
7
  import spaces
8
- from diffusers import DiffusionPipeline, AutoencoderTiny, AutoencoderKL
9
  import copy
10
  import random
11
  import time
@@ -32,7 +32,7 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
32
  base_model = "John6666/hyper-flux1-dev-fp8-flux"
33
  taef1 = AutoencoderTiny.from_pretrained("madebyollin/taef1", torch_dtype=dtype).to(device)
34
  good_vae = AutoencoderKL.from_pretrained("black-forest-labs/FLUX.1-dev", subfolder="vae", torch_dtype=dtype).to(device)
35
- pipe = StableDiffusionPipeline.from_pretrained(base_model, torch_dtype=dtype, vae=good_vae).to(device)
36
 
37
  model_id = ("zer0int/LongCLIP-GmP-ViT-L-14")
38
  config = CLIPConfig.from_pretrained(model_id)
@@ -44,9 +44,6 @@ pipe.text_encoder = clip_model.text_model
44
  pipe.tokenizer_max_length = 248
45
  pipe.text_encoder.dtype = torch.bfloat16
46
 
47
- pipe.transformer.enable_layerwise_casting(
48
- storage_dtype=torch.float8_e4m3fn, compute_dtype=torch.bfloat16
49
- )
50
  MAX_SEED = 2**32-1
51
 
52
  class calculateDuration:
 
5
  import torch
6
  from PIL import Image
7
  import spaces
8
+ from diffusers import DiffusionPipeline, AutoencoderTiny, AutoencoderKL, AutoPipelineForText2Image
9
  import copy
10
  import random
11
  import time
 
32
  base_model = "John6666/hyper-flux1-dev-fp8-flux"
33
  taef1 = AutoencoderTiny.from_pretrained("madebyollin/taef1", torch_dtype=dtype).to(device)
34
  good_vae = AutoencoderKL.from_pretrained("black-forest-labs/FLUX.1-dev", subfolder="vae", torch_dtype=dtype).to(device)
35
+ pipe = AutoPipelineForText2Image.from_pretrained(base_model, torch_dtype=dtype, vae=good_vae).to(device)
36
 
37
  model_id = ("zer0int/LongCLIP-GmP-ViT-L-14")
38
  config = CLIPConfig.from_pretrained(model_id)
 
44
  pipe.tokenizer_max_length = 248
45
  pipe.text_encoder.dtype = torch.bfloat16
46
 
 
 
 
47
  MAX_SEED = 2**32-1
48
 
49
  class calculateDuration: