Spaces:
Running
on
Zero
Running
on
Zero
XuDongZhou
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -42,7 +42,7 @@ weight_dtype = torch.float16 if str(device).__contains__("cuda") else torch.floa
|
|
42 |
|
43 |
base_model = 'frankjoshua/realvisxlV40_v40Bakedvae'
|
44 |
vae_path = 'madebyollin/sdxl-vae-fp16-fix'
|
45 |
-
ckpt = 'RED-AIGC/InstantID-XS'
|
46 |
|
47 |
image_proj_path = "./ckpt/image_proj.bin"
|
48 |
cnxs_path = "./ckpt/controlnetxs.bin"
|
@@ -90,9 +90,10 @@ pipe = StableDiffusionXLInstantIDXSPipeline.from_pretrained(
|
|
90 |
torch_dtype=weight_dtype,
|
91 |
)
|
92 |
|
93 |
-
pipe.cuda(device=device, dtype=weight_dtype, use_xformers=True)
|
|
|
94 |
|
95 |
-
print('Load IP-Adapter')
|
96 |
pipe.load_ip_adapter(image_proj_path, cross_attn_path)
|
97 |
|
98 |
pipe.scheduler = diffusers.EulerDiscreteScheduler.from_config(pipe.scheduler.config)
|
@@ -317,20 +318,15 @@ with gr.Blocks(css=css) as demo:
|
|
317 |
with gr.Column():
|
318 |
with gr.Row(equal_height=True):
|
319 |
# upload face image
|
320 |
-
face_file = gr.Image(
|
321 |
-
label="Upload a photo of your face", type="filepath"
|
322 |
-
)
|
323 |
# optional: upload a reference pose image
|
324 |
-
pose_file = gr.Image(
|
325 |
-
label="Upload a reference pose image (Optional)",
|
326 |
-
type="filepath",
|
327 |
-
)
|
328 |
|
329 |
# prompt
|
330 |
prompt = gr.Textbox(
|
331 |
label="Prompt",
|
332 |
info="Give simple prompt is enough to achieve good face fidelity",
|
333 |
-
placeholder="
|
334 |
value="",
|
335 |
)
|
336 |
|
|
|
42 |
|
43 |
base_model = 'frankjoshua/realvisxlV40_v40Bakedvae'
|
44 |
vae_path = 'madebyollin/sdxl-vae-fp16-fix'
|
45 |
+
# ckpt = 'RED-AIGC/InstantID-XS'
|
46 |
|
47 |
image_proj_path = "./ckpt/image_proj.bin"
|
48 |
cnxs_path = "./ckpt/controlnetxs.bin"
|
|
|
90 |
torch_dtype=weight_dtype,
|
91 |
)
|
92 |
|
93 |
+
# pipe.cuda(device=device, dtype=weight_dtype, use_xformers=True)
|
94 |
+
pipe.cuda(device=device, dtype=weight_dtype, use_xformers=False)
|
95 |
|
96 |
+
print('Load IP-Adapter...')
|
97 |
pipe.load_ip_adapter(image_proj_path, cross_attn_path)
|
98 |
|
99 |
pipe.scheduler = diffusers.EulerDiscreteScheduler.from_config(pipe.scheduler.config)
|
|
|
318 |
with gr.Column():
|
319 |
with gr.Row(equal_height=True):
|
320 |
# upload face image
|
321 |
+
face_file = gr.Image(label="Upload a photo of your face", type="filepath")
|
|
|
|
|
322 |
# optional: upload a reference pose image
|
323 |
+
pose_file = gr.Image(label="Upload a reference pose image (Optional)",type="filepath",)
|
|
|
|
|
|
|
324 |
|
325 |
# prompt
|
326 |
prompt = gr.Textbox(
|
327 |
label="Prompt",
|
328 |
info="Give simple prompt is enough to achieve good face fidelity",
|
329 |
+
placeholder="a woman, (looking at the viewer), portrait, daily wear, 8K texture, realistic, symmetrical hyperdetailed texture, masterpiece, enhanced details, (eye highlight:2), perfect composition, natural lighting, best quality, authentic, natural posture",
|
330 |
value="",
|
331 |
)
|
332 |
|