Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,9 @@ from google.genai import types
|
|
6 |
import gradio as gr
|
7 |
import io
|
8 |
from PIL import Image
|
|
|
|
|
|
|
9 |
|
10 |
def save_binary_file(file_name, data):
|
11 |
f = open(file_name, "wb")
|
@@ -15,7 +18,7 @@ def save_binary_file(file_name, data):
|
|
15 |
def generate_image(prompt, image=None):
|
16 |
# Initialize client with the API key
|
17 |
client = genai.Client(
|
18 |
-
api_key=
|
19 |
)
|
20 |
|
21 |
model = "gemini-2.0-flash-exp-image-generation"
|
|
|
6 |
import gradio as gr
|
7 |
import io
|
8 |
from PIL import Image
|
9 |
+
from huggingface_hub import login
|
10 |
+
|
11 |
+
GEMINI_KEY = os.environ.get("GEMINI_API_KEY")
|
12 |
|
13 |
def save_binary_file(file_name, data):
|
14 |
f = open(file_name, "wb")
|
|
|
18 |
def generate_image(prompt, image=None):
|
19 |
# Initialize client with the API key
|
20 |
client = genai.Client(
|
21 |
+
api_key=GEMINI_KEY,
|
22 |
)
|
23 |
|
24 |
model = "gemini-2.0-flash-exp-image-generation"
|