Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ import random
|
|
9 |
|
10 |
import gradio as gr
|
11 |
|
12 |
-
def generate(logo=None, Vtubername=""):
|
13 |
if(logo==None):
|
14 |
gr.Warning('Please Select Your Photo📸')
|
15 |
|
@@ -17,6 +17,9 @@ def generate(logo=None, Vtubername=""):
|
|
17 |
Vtubername = "unkown"
|
18 |
gr.Warning('Please Select Your Name😱')
|
19 |
|
|
|
|
|
|
|
20 |
def extract_dominant_colors(img, num_colors=3, ignore_edges=True):
|
21 |
if img.mode == 'RGBA':
|
22 |
image = img.convert('RGB')
|
@@ -86,7 +89,6 @@ def generate(logo=None, Vtubername=""):
|
|
86 |
|
87 |
import requests
|
88 |
import os
|
89 |
-
sdkey = os.environ["sdkey"]
|
90 |
from huggingface_hub import InferenceClient
|
91 |
|
92 |
client = InferenceClient(model="mistralai/Mixtral-8x7B-Instruct-v0.1")
|
@@ -227,10 +229,10 @@ iface = gr.Interface(
|
|
227 |
theme=gr.themes.Default(primary_hue="pink",font=[gr.themes.GoogleFont("Mochiy Pop One")]),
|
228 |
css=css,
|
229 |
fn=generate,
|
230 |
-
inputs=[gr.Image(label="VTuber Photo", type="pil"), gr.Textbox(label="VTuber Name(*alphabet only!*)")],
|
231 |
outputs=gr.Image(label="Generated Logo"),
|
232 |
title="VTuber Logo Generator",
|
233 |
-
description="①Upload photo you wanna VTuberize❤️ <br>② Input the name(*alphabet only!*)⭐️ <br>③Press Submit🧙",
|
234 |
examples=[["image.jpeg", "gojiteji"]],
|
235 |
|
236 |
allow_flagging=False
|
|
|
9 |
|
10 |
import gradio as gr
|
11 |
|
12 |
+
def generate(logo=None, Vtubername="", sdkey=""):
|
13 |
if(logo==None):
|
14 |
gr.Warning('Please Select Your Photo📸')
|
15 |
|
|
|
17 |
Vtubername = "unkown"
|
18 |
gr.Warning('Please Select Your Name😱')
|
19 |
|
20 |
+
if(sdkey==""):
|
21 |
+
gr.Warning('Please Set valid Stability AI API Key🔑')
|
22 |
+
|
23 |
def extract_dominant_colors(img, num_colors=3, ignore_edges=True):
|
24 |
if img.mode == 'RGBA':
|
25 |
image = img.convert('RGB')
|
|
|
89 |
|
90 |
import requests
|
91 |
import os
|
|
|
92 |
from huggingface_hub import InferenceClient
|
93 |
|
94 |
client = InferenceClient(model="mistralai/Mixtral-8x7B-Instruct-v0.1")
|
|
|
229 |
theme=gr.themes.Default(primary_hue="pink",font=[gr.themes.GoogleFont("Mochiy Pop One")]),
|
230 |
css=css,
|
231 |
fn=generate,
|
232 |
+
inputs=[gr.Image(label="VTuber Photo", type="pil"), gr.Textbox(label="VTuber Name(*alphabet only!*)"), gr.Textbox(label="Stability AI API Key")],
|
233 |
outputs=gr.Image(label="Generated Logo"),
|
234 |
title="VTuber Logo Generator",
|
235 |
+
description="①Upload photo you wanna VTuberize❤️ <br>② Input the name(*alphabet only!*)⭐️ <br>③ Set your SD3 key🔑(https://platform.stability.ai/account/keys) <br>④Press Submit🧙",
|
236 |
examples=[["image.jpeg", "gojiteji"]],
|
237 |
|
238 |
allow_flagging=False
|