macrdel commited on
Commit
e37bfc9
·
1 Parent(s): bbdd646

update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -5,12 +5,13 @@ import random
5
  # import spaces #[uncomment to use ZeroGPU]
6
  from diffusers import DiffusionPipeline, FluxPipeline
7
  import torch
 
8
 
9
  device = "cuda" if torch.cuda.is_available() else "cpu"
10
  torch_dtype = torch.bfloat16 if torch.cuda.is_available() else torch.float32
11
  model_repo = "black-forest-labs/FLUX.1-dev" # Replace to the model you would like to use
12
 
13
- pipe = FluxPipeline.from_pretrained(model_repo, torch_dtype=torch_dtype).to(device)
14
  #pipe.enable_model_cpu_offload()
15
 
16
  MAX_SEED = np.iinfo(np.int32).max
 
5
  # import spaces #[uncomment to use ZeroGPU]
6
  from diffusers import DiffusionPipeline, FluxPipeline
7
  import torch
8
+ import os
9
 
10
  device = "cuda" if torch.cuda.is_available() else "cpu"
11
  torch_dtype = torch.bfloat16 if torch.cuda.is_available() else torch.float32
12
  model_repo = "black-forest-labs/FLUX.1-dev" # Replace to the model you would like to use
13
 
14
+ pipe = FluxPipeline.from_pretrained(model_repo, torch_dtype=torch_dtype, token=f"{os.environ.get('tkn')}").to(device)
15
  #pipe.enable_model_cpu_offload()
16
 
17
  MAX_SEED = np.iinfo(np.int32).max