Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,10 +37,10 @@ pipe = QwenImagePipeline.from_pretrained(
|
|
| 37 |
|
| 38 |
|
| 39 |
speedup = hf_hub_download(repo_id="Tele-AI/TeleStyle", filename="weights/diffsynth_Qwen-Image-Edit-2509-Lightning-4steps-V1.0-bf16.safetensors")
|
| 40 |
-
|
| 41 |
|
| 42 |
|
| 43 |
-
pipe.load_lora(pipe.dit,
|
| 44 |
pipe.load_lora(pipe.dit,speedup)
|
| 45 |
|
| 46 |
|
|
@@ -125,20 +125,20 @@ examples = []
|
|
| 125 |
|
| 126 |
_HEADER_ = '''
|
| 127 |
<div style="text-align: center; max-width: 650px; margin: 0 auto;">
|
| 128 |
-
<h1 style="font-size: 2.5rem; font-weight: 700; margin-bottom: 1rem; display: contents;">
|
| 129 |
|
| 130 |
</div>
|
| 131 |
|
| 132 |
|
| 133 |
-
<p style="font-size: 1rem; margin-bottom: 1.5rem;">Paper: <a href='https://
|
| 134 |
'''
|
| 135 |
|
| 136 |
with gr.Blocks() as demo:
|
| 137 |
|
| 138 |
with gr.Column(elem_id="col-container"):
|
| 139 |
-
|
| 140 |
gr.Markdown(_HEADER_)
|
| 141 |
-
gr.Markdown("This is a demo of
|
| 142 |
with gr.Row():
|
| 143 |
with gr.Column():
|
| 144 |
with gr.Row():
|
|
@@ -199,22 +199,31 @@ with gr.Blocks() as demo:
|
|
| 199 |
step=8,
|
| 200 |
value=1024,
|
| 201 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 202 |
with gr.Row(), gr.Column():
|
| 203 |
gr.Markdown("## Examples")
|
| 204 |
gr.Markdown("changing the minedge could lead to different style similarity.")
|
| 205 |
default_prompt='Style Transfer the style of Figure 2 to Figure 1, and keep the content and characteristics of Figure 1.'
|
| 206 |
gr.Examples(examples=[
|
| 207 |
-
['./qwenstyleref/pulpfiction_2.jpg','./qwenstyleref/styleref=6_style_ref.png',default_prompt],
|
| 208 |
-
['./qwenstyleref/styleref=0_content_ref.png','./qwenstyleref/110.png',default_prompt],
|
| 209 |
-
['./qwenstyleref/romanholiday_1.jpg','./qwenstyleref/s0099____1113_01_query_1_img_000146_1682705733350_08158389675901344.jpg.jpg',default_prompt],
|
| 210 |
-
['./qwenstyleref/styleref=0_content_ref.png','./qwenstyleref/125.png',default_prompt],
|
| 211 |
-
['./qwenstyleref/fallenangle.jpg','./qwenstyleref/styleref=s0038.png',default_prompt],
|
| 212 |
-
['./qwenstyleref/styleref=0_content_ref.png','./qwenstyleref/styleref=s0572.png',default_prompt],
|
| 213 |
-
['./qwenstyleref/startrooper1.jpg','./qwenstyleref/david-face-760x985.jpg','Style Transfer Figure 1 into marble material.'],
|
| 214 |
-
['./qwenstyleref/possession.png','./qwenstyleref/s0026____0907_01_query_0_img_000194_1682674358294_041656249089406583.jpeg.jpg',default_prompt],
|
| 215 |
-
['./qwenstyleref/styleref=0_content_ref.png','./qwenstyleref/Jotarokujo.webp',default_prompt],
|
| 216 |
-
['./qwenstyleref/wallstreet1.jpg','./qwenstyleref/034.png',default_prompt],
|
| 217 |
-
['./qwenstyleref/bird.jpeg','./qwenstyleref/styleref=s0539.png',default_prompt],
|
| 218 |
|
| 219 |
|
| 220 |
|
|
@@ -249,4 +258,4 @@ with gr.Blocks() as demo:
|
|
| 249 |
)
|
| 250 |
|
| 251 |
if __name__ == "__main__":
|
| 252 |
-
demo.launch(server_name='0.0.0.0')
|
|
|
|
| 37 |
|
| 38 |
|
| 39 |
speedup = hf_hub_download(repo_id="Tele-AI/TeleStyle", filename="weights/diffsynth_Qwen-Image-Edit-2509-Lightning-4steps-V1.0-bf16.safetensors")
|
| 40 |
+
telestyle= hf_hub_download(repo_id="Tele-AI/TeleStyle", filename="weights/diffsynth_Qwen-Image-Edit-2509-telestyle.safetensors")
|
| 41 |
|
| 42 |
|
| 43 |
+
pipe.load_lora(pipe.dit, telestyle)
|
| 44 |
pipe.load_lora(pipe.dit,speedup)
|
| 45 |
|
| 46 |
|
|
|
|
| 125 |
|
| 126 |
_HEADER_ = '''
|
| 127 |
<div style="text-align: center; max-width: 650px; margin: 0 auto;">
|
| 128 |
+
<h1 style="font-size: 2.5rem; font-weight: 700; margin-bottom: 1rem; display: contents;">TeleStyle</h1>
|
| 129 |
|
| 130 |
</div>
|
| 131 |
|
| 132 |
|
| 133 |
+
<p style="font-size: 1rem; margin-bottom: 1.5rem;">Paper: <a href='https://arxiv.org/abs/2601.20175' target='_blank'>TeleStyle: Content-Preserving Style Transfer in Images and Videos</a> | Codes: <a href='https://github.com/Tele-AI/TeleStyle/' target='_blank'>GitHub</a></p>
|
| 134 |
'''
|
| 135 |
|
| 136 |
with gr.Blocks() as demo:
|
| 137 |
|
| 138 |
with gr.Column(elem_id="col-container"):
|
| 139 |
+
|
| 140 |
gr.Markdown(_HEADER_)
|
| 141 |
+
gr.Markdown("This is a demo of TeleStyle-Image, enabling Content-Preserving Style Transfer capability to Qwen-Image-Edit-2509.")
|
| 142 |
with gr.Row():
|
| 143 |
with gr.Column():
|
| 144 |
with gr.Row():
|
|
|
|
| 199 |
step=8,
|
| 200 |
value=1024,
|
| 201 |
)
|
| 202 |
+
content_ref,
|
| 203 |
+
style_ref,
|
| 204 |
+
prompt,
|
| 205 |
+
seed=123,
|
| 206 |
+
randomize_seed=False,
|
| 207 |
+
true_guidance_scale=1.0,
|
| 208 |
+
num_inference_steps=4,
|
| 209 |
+
minedge=1024,
|
| 210 |
+
progress=gr.Progress(track_tqdm=True),
|
| 211 |
with gr.Row(), gr.Column():
|
| 212 |
gr.Markdown("## Examples")
|
| 213 |
gr.Markdown("changing the minedge could lead to different style similarity.")
|
| 214 |
default_prompt='Style Transfer the style of Figure 2 to Figure 1, and keep the content and characteristics of Figure 1.'
|
| 215 |
gr.Examples(examples=[
|
| 216 |
+
['./qwenstyleref/pulpfiction_2.jpg','./qwenstyleref/styleref=6_style_ref.png',default_prompt,123,False,1.0,4,832],
|
| 217 |
+
['./qwenstyleref/styleref=0_content_ref.png','./qwenstyleref/110.png',default_prompt,123,False,1.0,4,832],
|
| 218 |
+
['./qwenstyleref/romanholiday_1.jpg','./qwenstyleref/s0099____1113_01_query_1_img_000146_1682705733350_08158389675901344.jpg.jpg',default_prompt,123,False,1.0,4,800],
|
| 219 |
+
['./qwenstyleref/styleref=0_content_ref.png','./qwenstyleref/125.png',default_prompt,123,False,1.0,4,832],
|
| 220 |
+
['./qwenstyleref/fallenangle.jpg','./qwenstyleref/styleref=s0038.png',default_prompt,123,False,1.0,4,832],
|
| 221 |
+
['./qwenstyleref/styleref=0_content_ref.png','./qwenstyleref/styleref=s0572.png',default_prompt,123,False,1.0,4,832],
|
| 222 |
+
['./qwenstyleref/startrooper1.jpg','./qwenstyleref/david-face-760x985.jpg','Style Transfer Figure 1 into marble material.',123,False,1.0,4,1024],
|
| 223 |
+
['./qwenstyleref/possession.png','./qwenstyleref/s0026____0907_01_query_0_img_000194_1682674358294_041656249089406583.jpeg.jpg',default_prompt,123,False,1.0,4,832],
|
| 224 |
+
['./qwenstyleref/styleref=0_content_ref.png','./qwenstyleref/Jotarokujo.webp',default_prompt,123,False,1.0,4,832],
|
| 225 |
+
['./qwenstyleref/wallstreet1.jpg','./qwenstyleref/034.png',default_prompt,123,False,1.0,4,1024],
|
| 226 |
+
['./qwenstyleref/bird.jpeg','./qwenstyleref/styleref=s0539.png',default_prompt,123,False,1.0,4,832],
|
| 227 |
|
| 228 |
|
| 229 |
|
|
|
|
| 258 |
)
|
| 259 |
|
| 260 |
if __name__ == "__main__":
|
| 261 |
+
demo.launch(server_name='0.0.0.0')
|