ovi054 commited on
Commit
c7accf3
1 Parent(s): 160b513

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -13,10 +13,13 @@ API_TOKEN = os.getenv("HF_READ_TOKEN")
13
  headers = {"Authorization": f"Bearer {API_TOKEN}"}
14
  timeout = 100
15
 
16
- def query(lora_id="ByteDance/Hyper-SD", prompt, is_negative=False, steps=28, cfg_scale=3.5, sampler="DPM++ 2M Karras", seed=-1, strength=0.7):
17
  if prompt == "" or prompt == None:
18
  return None
19
 
 
 
 
20
  key = random.randint(0, 999)
21
 
22
  API_URL = "https://api-inference.huggingface.co/models/"+ lora_id
@@ -77,7 +80,7 @@ with gr.Blocks(theme='Nymbo/Nymbo_Theme', css=css) as app:
77
  with gr.Row():
78
  text_prompt = gr.Textbox(label="Prompt", placeholder="Enter a prompt here", lines=2, elem_id="prompt-text-input")
79
  with gr.Row():
80
- custom_lora = gr.Textbox(label="Custom LoRA", info="LoRA Hugging Face path", value="", placeholder="multimodalart/vintage-ads-flux")
81
  with gr.Row():
82
  with gr.Accordion("Advanced Settings", open=False):
83
  negative_prompt = gr.Textbox(label="Negative Prompt", placeholder="What should not be in the image", value="(deformed, distorted, disfigured), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, (mutated hands and fingers), disconnected limbs, mutation, mutated, ugly, disgusting, blurry, amputation, misspellings, typos", lines=3, elem_id="negative-prompt-text-input")
 
13
  headers = {"Authorization": f"Bearer {API_TOKEN}"}
14
  timeout = 100
15
 
16
+ def query(lora_id, prompt, is_negative=False, steps=28, cfg_scale=3.5, sampler="DPM++ 2M Karras", seed=-1, strength=0.7):
17
  if prompt == "" or prompt == None:
18
  return None
19
 
20
+ if lora_id.strip() == "" or lora_id == None:
21
+ lora_id = "ByteDance/Hyper-SD"
22
+
23
  key = random.randint(0, 999)
24
 
25
  API_URL = "https://api-inference.huggingface.co/models/"+ lora_id
 
80
  with gr.Row():
81
  text_prompt = gr.Textbox(label="Prompt", placeholder="Enter a prompt here", lines=2, elem_id="prompt-text-input")
82
  with gr.Row():
83
+ custom_lora = gr.Textbox(label="Custom LoRA", info="LoRA Hugging Face path", placeholder="multimodalart/vintage-ads-flux")
84
  with gr.Row():
85
  with gr.Accordion("Advanced Settings", open=False):
86
  negative_prompt = gr.Textbox(label="Negative Prompt", placeholder="What should not be in the image", value="(deformed, distorted, disfigured), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, (mutated hands and fingers), disconnected limbs, mutation, mutated, ugly, disgusting, blurry, amputation, misspellings, typos", lines=3, elem_id="negative-prompt-text-input")