fantaxy commited on
Commit
2f1a8cd
1 Parent(s): fd925b9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -20
app.py CHANGED
@@ -151,31 +151,18 @@ def generate_image(
151
  img = Image.fromarray((127.5 * (x + 1.0)).cpu().byte().numpy())
152
  return img, str(opts.seed), flux_generator.pulid_model.debug_img_list
153
 
154
- _HEADER_ = '''
155
- <div style="text-align: center; max-width: 650px; margin: 0 auto;">
156
- <h1 style="font-size: 2.5rem; font-weight: 700; margin-bottom: 1rem; display: contents;">PuLID for FLUX</h1>
157
- <p style="font-size: 1rem; margin-bottom: 1.5rem;">Paper: <a href='https://arxiv.org/abs/2404.16022' target='_blank'>PuLID: Pure and Lightning ID Customization via Contrastive Alignment</a> | Codes: <a href='https://github.com/ToTheBeginning/PuLID' target='_blank'>GitHub</a></p>
158
- </div>
159
 
160
- ❗️❗️❗️**Tips:**
161
- - `timestep to start inserting ID:` The smaller the value, the higher the fidelity, but the lower the editability; the higher the value, the lower the fidelity, but the higher the editability. **The recommended range for this value is between 0 and 4**. For photorealistic scenes, we recommend using 4; for stylized scenes, we recommend using 0-1. If you are not satisfied with the similarity, you can lower this value; conversely, if you are not satisfied with the editability, you can increase this value.
162
- - `true CFG scale:` In most scenarios, it is recommended to use a fake CFG, i.e., setting the true CFG scale to 1, and just adjusting the guidance scale. This is also more efficiency. However, in a few cases, utilizing a true CFG can yield better results. For more detaileds, please refer to the [doc](https://github.com/ToTheBeginning/PuLID/blob/main/docs/pulid_for_flux.md#useful-tips).
163
- - please refer to the <a href='https://github.com/ToTheBeginning/PuLID/blob/main/docs/pulid_for_flux.md' target='_blank'>github doc</a> for more details and info about the model, we provide the detail explanation about the above two parameters in the doc.
164
- - we provide some examples in the bottom, you can try these example prompts first
165
- ''' # noqa E501
166
-
167
- _CITE_ = r"""
168
- If PuLID is helpful, please help to ⭐ the <a href='https://github.com/ToTheBeginning/PuLID' target='_blank'> Github Repo</a>. Thanks!
169
- ---
170
-
171
- 📧 **Contact**
172
- If you have any questions or feedbacks, feel free to open a discussion or contact <b>[email protected]</b>.
173
- """ # noqa E501
174
 
175
 
176
  def create_demo(args, model_name: str, device: str = "cuda" if torch.cuda.is_available() else "cpu",
177
  offload: bool = False):
178
- with gr.Blocks() as demo:
 
179
  gr.Markdown(_HEADER_)
180
 
181
  with gr.Row():
 
151
  img = Image.fromarray((127.5 * (x + 1.0)).cpu().byte().numpy())
152
  return img, str(opts.seed), flux_generator.pulid_model.debug_img_list
153
 
 
 
 
 
 
154
 
155
+ css = """
156
+ footer {
157
+ visibility: hidden;
158
+ }
159
+ """
 
 
 
 
 
 
 
 
 
160
 
161
 
162
  def create_demo(args, model_name: str, device: str = "cuda" if torch.cuda.is_available() else "cpu",
163
  offload: bool = False):
164
+
165
+ with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css) as demo:
166
  gr.Markdown(_HEADER_)
167
 
168
  with gr.Row():