MohamedTalaat91 commited on
Commit
ec40bee
Β·
verified Β·
1 Parent(s): 93e5fbe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -13,7 +13,7 @@ from flux.sampling import denoise, get_noise, get_schedule, prepare, unpack
13
  from flux.util import load_ae, load_clip, load_flow_model, load_t5
14
  from pulid.pipeline_flux import PuLIDPipeline
15
  from pulid.utils import resize_numpy_image_long
16
-
17
  NSFW_THRESHOLD = 0.85
18
 
19
  def get_models(name: str, device: torch.device, offload: bool):
@@ -165,7 +165,8 @@ _HEADER_ = '''
165
  </div>
166
 
167
  ''' # noqa E501
168
-
 
169
 
170
 
171
  def create_demo(args, model_name: str, device: str = "cuda" if torch.cuda.is_available() else "cpu",
@@ -176,7 +177,7 @@ def create_demo(args, model_name: str, device: str = "cuda" if torch.cuda.is_ava
176
 
177
  with gr.Row():
178
  with gr.Column():
179
- prompt = gr.Textbox(label="Prompt", value="portrait, color, cinematic")
180
  id_image = gr.Image(label="ID Image")
181
  id_weight = gr.Slider(0.0, 3.0, 1, step=0.05, label="id weight")
182
 
 
13
  from flux.util import load_ae, load_clip, load_flow_model, load_t5
14
  from pulid.pipeline_flux import PuLIDPipeline
15
  from pulid.utils import resize_numpy_image_long
16
+ from prompt_template import prompt_dict
17
  NSFW_THRESHOLD = 0.85
18
 
19
  def get_models(name: str, device: torch.device, offload: bool):
 
165
  </div>
166
 
167
  ''' # noqa E501
168
+ PROMPTS = list(prompt_dict.keys())
169
+ DEFAULT_PROMPT_NAME = "Paris"
170
 
171
 
172
  def create_demo(args, model_name: str, device: str = "cuda" if torch.cuda.is_available() else "cpu",
 
177
 
178
  with gr.Row():
179
  with gr.Column():
180
+ prompt = gr.Dropdown(label="PROMPT", choices=PROMPTS, value=DEFAULT_PROMPT_NAME)
181
  id_image = gr.Image(label="ID Image")
182
  id_weight = gr.Slider(0.0, 3.0, 1, step=0.05, label="id weight")
183