Spaces:
Sleeping
Sleeping
Andre
commited on
Commit
·
9c69778
1
Parent(s):
6e211a4
Update
Browse files
colab.ipynb
CHANGED
@@ -13,8 +13,8 @@
|
|
13 |
"import ipywidgets as widgets\n",
|
14 |
"from huggingface_hub import InferenceClient\n",
|
15 |
"from IPython.display import display, clear_output\n",
|
16 |
-
"from img_gen_logic_colab import generate_image, save_image\n",
|
17 |
-
"from config_colab import models, prompts, api_token\n",
|
18 |
"from PIL import Image\n",
|
19 |
"from google.colab import userdata\n",
|
20 |
"from datetime import datetime\n",
|
@@ -165,7 +165,7 @@
|
|
165 |
" # Save the image with a timestamped filename\n",
|
166 |
" output_filename = save_image(image, model_dropdown.label, prompt_dropdown.label, selected_team)\n",
|
167 |
" print(f\"Image saved as {output_filename}\")\n",
|
168 |
-
"
|
169 |
"# Attach the button click event handler\n",
|
170 |
"generate_button.on_click(on_generate_button_clicked)\n",
|
171 |
"\n",
|
|
|
13 |
"import ipywidgets as widgets\n",
|
14 |
"from huggingface_hub import InferenceClient\n",
|
15 |
"from IPython.display import display, clear_output\n",
|
16 |
+
"from src.img_gen_logic_colab import generate_image, save_image\n",
|
17 |
+
"from config.config_colab import models, prompts, api_token\n",
|
18 |
"from PIL import Image\n",
|
19 |
"from google.colab import userdata\n",
|
20 |
"from datetime import datetime\n",
|
|
|
165 |
" # Save the image with a timestamped filename\n",
|
166 |
" output_filename = save_image(image, model_dropdown.label, prompt_dropdown.label, selected_team)\n",
|
167 |
" print(f\"Image saved as {output_filename}\")\n",
|
168 |
+
"\n",
|
169 |
"# Attach the button click event handler\n",
|
170 |
"generate_button.on_click(on_generate_button_clicked)\n",
|
171 |
"\n",
|
config.py → config/config.py
RENAMED
File without changes
|
config_colab.py → config/config_colab.py
RENAMED
File without changes
|
gradio_interface.py → src/gradio_interface.py
RENAMED
@@ -1,7 +1,7 @@
|
|
1 |
-
# gradio_interface.py
|
2 |
import gradio as gr
|
3 |
from img_gen_logic import generate_image # Direct import
|
4 |
-
from config import prompts, models # Direct import
|
5 |
|
6 |
def generate(prompt_alias, team, model_alias, custom_prompt, height=360, width=640, num_inference_steps=20, guidance_scale=2.0, seed=-1):
|
7 |
try:
|
|
|
1 |
+
# gradio_interface.py (HuggingFace Spaces)
|
2 |
import gradio as gr
|
3 |
from img_gen_logic import generate_image # Direct import
|
4 |
+
from config.config import prompts, models # Direct import
|
5 |
|
6 |
def generate(prompt_alias, team, model_alias, custom_prompt, height=360, width=640, num_inference_steps=20, guidance_scale=2.0, seed=-1):
|
7 |
try:
|
img_gen_logic.py → src/img_gen_logic.py
RENAMED
File without changes
|
img_gen_logic_colab.py → src/img_gen_logic_colab.py
RENAMED
File without changes
|