artificialguybr commited on
Commit
9f29ad9
1 Parent(s): 7ce51a2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -35,8 +35,9 @@ def run_lora(prompt, selected_state, progress=gr.Progress(track_tqdm=True)):
35
  api_url = f"https://api-inference.huggingface.co/models/{selected_lora['repo']}"
36
  trigger_word = selected_lora["trigger_word"]
37
  #token = os.getenv("API_TOKEN")
38
- payload = {"inputs": f"{prompt} {trigger_word}"}
39
-
 
40
  #headers = {"Authorization": f"Bearer {token}"}
41
 
42
  # Add a print statement to display the API request
@@ -67,7 +68,12 @@ def run_lora(prompt, selected_state, progress=gr.Progress(track_tqdm=True)):
67
 
68
  with gr.Blocks(css="custom.css") as app:
69
  title = gr.Markdown("# artificialguybr LoRA portfolio")
70
- selected_state = gr.State()
 
 
 
 
 
71
  with gr.Row():
72
  gallery = gr.Gallery(
73
  [(item["image"], item["title"]) for item in loras],
 
35
  api_url = f"https://api-inference.huggingface.co/models/{selected_lora['repo']}"
36
  trigger_word = selected_lora["trigger_word"]
37
  #token = os.getenv("API_TOKEN")
38
+ payload = {
39
+ "inputs": f"{prompt} {trigger_word}",
40
+ "negative_prompt": "bad art, ugly, watermark, deformed" # Add this line
41
  #headers = {"Authorization": f"Bearer {token}"}
42
 
43
  # Add a print statement to display the API request
 
68
 
69
  with gr.Blocks(css="custom.css") as app:
70
  title = gr.Markdown("# artificialguybr LoRA portfolio")
71
+ description = gr.Markdown( # Add this line
72
+ "### This is my portfolio. Follow me on Twitter [@artificialguybr](https://twitter.com/artificialguybr). "
73
+ "Note: The speed and generation quality are for demonstration purposes. "
74
+ "For best quality, use Auto or Comfy. Special thanks to Hugging Face for their free inference API."
75
+ )
76
+ selected_state = gr.State()
77
  with gr.Row():
78
  gallery = gr.Gallery(
79
  [(item["image"], item["title"]) for item in loras],