Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -81,7 +81,7 @@ def generate_image(
|
|
| 81 |
|
| 82 |
if id_image is not None:
|
| 83 |
id_image = resize_numpy_image_long(id_image, 1024)
|
| 84 |
-
id_embeddings, uncond_id_embeddings = flux_generator.
|
| 85 |
else:
|
| 86 |
id_embeddings = None
|
| 87 |
uncond_id_embeddings = None
|
|
@@ -149,7 +149,7 @@ def generate_image(
|
|
| 149 |
x = rearrange(x[0], "c h w -> h w c")
|
| 150 |
|
| 151 |
img = Image.fromarray((127.5 * (x + 1.0)).cpu().byte().numpy())
|
| 152 |
-
return img, str(opts.seed), flux_generator.
|
| 153 |
|
| 154 |
_HEADER_ = '''
|
| 155 |
<div style="text-align: center; max-width: 650px; margin: 0 auto;">
|
|
@@ -157,7 +157,7 @@ _HEADER_ = '''
|
|
| 157 |
</div>
|
| 158 |
❗️❗️❗️**Tips:**
|
| 159 |
- `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.
|
| 160 |
-
- `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.
|
| 161 |
- we provide some examples in the bottom, you can try these example prompts first
|
| 162 |
'''
|
| 163 |
|
|
|
|
| 81 |
|
| 82 |
if id_image is not None:
|
| 83 |
id_image = resize_numpy_image_long(id_image, 1024)
|
| 84 |
+
id_embeddings, uncond_id_embeddings = flux_generator.toonmage_model.get_id_embedding(id_image, cal_uncond=use_true_cfg)
|
| 85 |
else:
|
| 86 |
id_embeddings = None
|
| 87 |
uncond_id_embeddings = None
|
|
|
|
| 149 |
x = rearrange(x[0], "c h w -> h w c")
|
| 150 |
|
| 151 |
img = Image.fromarray((127.5 * (x + 1.0)).cpu().byte().numpy())
|
| 152 |
+
return img, str(opts.seed), flux_generator.toonmage_model.debug_img_list
|
| 153 |
|
| 154 |
_HEADER_ = '''
|
| 155 |
<div style="text-align: center; max-width: 650px; margin: 0 auto;">
|
|
|
|
| 157 |
</div>
|
| 158 |
❗️❗️❗️**Tips:**
|
| 159 |
- `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.
|
| 160 |
+
- `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.
|
| 161 |
- we provide some examples in the bottom, you can try these example prompts first
|
| 162 |
'''
|
| 163 |
|