artificialguybr commited on
Commit
56a2aed
1 Parent(s): f5b0466

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -8
app.py CHANGED
@@ -6,13 +6,13 @@ from io import BytesIO
6
  from tqdm import tqdm
7
  import time
8
 
9
- # Setting the repository information and the trigger word
10
  repo = "artificialguybr/StudioGhibli.Redmond-V2"
11
  trigger_word = "Studio Ghibli, StdGBRedmAF"
12
 
13
  def generate_image(prompt):
14
  api_url = f"https://api-inference.huggingface.co/models/{repo}"
15
- # Uncomment and use your Hugging Face API token
16
  # token = os.getenv("API_TOKEN")
17
  headers = {
18
  # "Authorization": f"Bearer {token}"
@@ -43,17 +43,21 @@ def generate_image(prompt):
43
  raise Exception(f"API Error: {response.status_code}")
44
 
45
  css = """
46
- body { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; }
47
- h1 { color: #333; }
48
- .gradio-container { max-width: 700px; margin: auto; }
 
 
 
 
49
  """
50
 
51
  iface = gr.Interface(
52
  fn=generate_image,
53
- inputs=gr.Textbox(lines=2, placeholder="Enter your prompt here..."),
54
  outputs="image",
55
- title="Studio Ghibli Image Generator V2",
56
- description="Enter a text prompt to generate an image in the style of Studio Ghibli.",
57
  css=css
58
  )
59
 
 
6
  from tqdm import tqdm
7
  import time
8
 
9
+ # Definindo as informações do repositório e a trigger word
10
  repo = "artificialguybr/StudioGhibli.Redmond-V2"
11
  trigger_word = "Studio Ghibli, StdGBRedmAF"
12
 
13
  def generate_image(prompt):
14
  api_url = f"https://api-inference.huggingface.co/models/{repo}"
15
+ # Descomente e use seu token da API do Hugging Face
16
  # token = os.getenv("API_TOKEN")
17
  headers = {
18
  # "Authorization": f"Bearer {token}"
 
43
  raise Exception(f"API Error: {response.status_code}")
44
 
45
  css = """
46
+ body { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #f0f0f0; }
47
+ h1 { color: #333; text-align: center; }
48
+ h2 { color: #555; }
49
+ .gradio-container { max-width: 800px; margin: auto; padding: 20px; border-radius: 10px; background-color: #fff; box-shadow: 0 0 10px rgba(0,0,0,0.1); }
50
+ .gradio-input, .gradio-output { margin-bottom: 20px; }
51
+ .gradio-button { background-color: #4CAF50; color: white; padding: 14px 20px; margin: 10px 0; border: none; border-radius: 4px; cursor: pointer; }
52
+ .gradio-button:hover { background-color: #45a049; }
53
  """
54
 
55
  iface = gr.Interface(
56
  fn=generate_image,
57
+ inputs=gr.Textbox(lines=2, placeholder="Enter a Studio Ghibli style prompt..."),
58
  outputs="image",
59
+ title="Studio Ghibli Style Image Generator",
60
+ description="Type a prompt and generate an image with the enchanting Studio Ghibli aesthetic.",
61
  css=css
62
  )
63