Axel-Student commited on
Commit
424839d
·
1 Parent(s): 43c767e

added login

Browse files
Files changed (3) hide show
  1. .gitignore +1 -0
  2. Dockerfile +1 -0
  3. app.py +4 -1
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ .env
Dockerfile CHANGED
@@ -8,6 +8,7 @@ RUN pip install git+https://github.com/huggingface/diffusers.git
8
  RUN pip install transformers
9
  RUN pip install accelerate
10
  RUN pip install huggingface_hub
 
11
 
12
  COPY . /app
13
 
 
8
  RUN pip install transformers
9
  RUN pip install accelerate
10
  RUN pip install huggingface_hub
11
+ RUN pip install python-dotenv
12
 
13
  COPY . /app
14
 
app.py CHANGED
@@ -1,11 +1,14 @@
 
1
  import torch
2
  from diffusers import FluxPipeline # type: ignore
3
  import gradio as gr # type: ignore
4
  from huggingface_hub import login
5
- login()
6
 
7
  pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16)
8
  pipe.enable_model_cpu_offload() #save some VRAM by offloading the model to CPU. Remove this if you have enough GPU power
 
 
 
9
 
10
  prompt = "A cat holding a sign that says hello world"
11
  image = pipe(
 
1
+ import os
2
  import torch
3
  from diffusers import FluxPipeline # type: ignore
4
  import gradio as gr # type: ignore
5
  from huggingface_hub import login
 
6
 
7
  pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16)
8
  pipe.enable_model_cpu_offload() #save some VRAM by offloading the model to CPU. Remove this if you have enough GPU power
9
+ token = os.getenv("HF_TOKEN")
10
+ login(token=token)
11
+
12
 
13
  prompt = "A cat holding a sign that says hello world"
14
  image = pipe(