K00B404 commited on
Commit
ed16a16
·
verified ·
1 Parent(s): 402ac83

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -14,7 +14,7 @@ os.environ["HF_HOME"] = cache_path
14
  import gradio as gr
15
  import torch
16
  from diffusers import FluxPipeline
17
- os.system(f"bash huggingface-cli login --token {os.getenv('HF_TOKEN')} --add-to-git-credential")
18
  torch.backends.cuda.matmul.allow_tf32 = True
19
 
20
  class timer:
@@ -33,19 +33,17 @@ from huggingface_hub import hf_hub_download
33
  import torch
34
 
35
  from diffusers import FluxPipeline, FluxTransformer2DModel, GGUFQuantizationConfig
36
-
37
  ckpt_path = (
38
- "https://huggingface.co/OlegSkutte/SDXL-Lightning-GGUF/resolve/main/sdxl_lightning_4step.q8_0.gguf"
39
  )
40
  transformer = FluxTransformer2DModel.from_single_file(
41
  ckpt_path,
42
- token=os.getenv('HF_TOKEN'),
43
  quantization_config=GGUFQuantizationConfig(compute_dtype=torch.bfloat16),
44
  torch_dtype=torch.bfloat16,
45
  )
46
  pipe = FluxPipeline.from_pretrained(
47
  "black-forest-labs/FLUX.1-dev",
48
- token=os.getenv('HF_TOKEN'),
49
  transformer=transformer,
50
  torch_dtype=torch.bfloat16,
51
  )
 
14
  import gradio as gr
15
  import torch
16
  from diffusers import FluxPipeline
17
+
18
  torch.backends.cuda.matmul.allow_tf32 = True
19
 
20
  class timer:
 
33
  import torch
34
 
35
  from diffusers import FluxPipeline, FluxTransformer2DModel, GGUFQuantizationConfig
36
+ os.system("wget https://huggingface.co/city96/flux.1-lite-8B-alpha-gguf/flux.1-lite-8B-alpha-Q3_K_S.gguf -O ./model_ggufs/city96/flux.1-lite-8B-alpha-gguf/flux.1-lite-8B-alpha-Q3_K_S.gguf")
37
  ckpt_path = (
38
+ "./model_ggufs/city96/flux.1-lite-8B-alpha-gguf/flux.1-lite-8B-alpha-Q3_K_S.gguf"
39
  )
40
  transformer = FluxTransformer2DModel.from_single_file(
41
  ckpt_path,
 
42
  quantization_config=GGUFQuantizationConfig(compute_dtype=torch.bfloat16),
43
  torch_dtype=torch.bfloat16,
44
  )
45
  pipe = FluxPipeline.from_pretrained(
46
  "black-forest-labs/FLUX.1-dev",
 
47
  transformer=transformer,
48
  torch_dtype=torch.bfloat16,
49
  )