Spaces:
Running
on
Zero
Running
on
Zero
Alexander Bagus
commited on
Commit
·
5d56951
1
Parent(s):
fb4dceb
22
Browse files- app.py +9 -9
- static/header.html +1 -1
app.py
CHANGED
|
@@ -83,10 +83,8 @@ def generate_lora(
|
|
| 83 |
embs = QwenImageUnit_Image2LoRAEncode().process(pipe, image2lora_images=images)
|
| 84 |
lora = QwenImageUnit_Image2LoRADecode().process(pipe, **embs)["lora"]
|
| 85 |
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
# print(lora_url)
|
| 90 |
|
| 91 |
save_file(lora, lora_path)
|
| 92 |
|
|
@@ -117,6 +115,10 @@ css = """
|
|
| 117 |
margin: 0 auto;
|
| 118 |
max-width: 960px;
|
| 119 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
"""
|
| 121 |
|
| 122 |
|
|
@@ -142,8 +144,8 @@ with gr.Blocks() as demo:
|
|
| 142 |
with gr.Column():
|
| 143 |
lora_path = gr.Textbox(label="Generated LoRA path",lines=2, interactive=False)
|
| 144 |
lora_download = gr.DownloadButton(label=f"Download LoRA", visible=has_lora)
|
| 145 |
-
with gr.
|
| 146 |
-
gr.Markdown("
|
| 147 |
with gr.Row():
|
| 148 |
with gr.Column():
|
| 149 |
prompt = gr.Textbox(
|
|
@@ -155,9 +157,7 @@ with gr.Blocks() as demo:
|
|
| 155 |
# container=False,
|
| 156 |
)
|
| 157 |
|
| 158 |
-
imagen_button = gr.Button("Generate Image", variant="primary")
|
| 159 |
-
|
| 160 |
-
|
| 161 |
with gr.Accordion("Advanced Settings", open=False):
|
| 162 |
|
| 163 |
negative_prompt = gr.Textbox(
|
|
|
|
| 83 |
embs = QwenImageUnit_Image2LoRAEncode().process(pipe, image2lora_images=images)
|
| 84 |
lora = QwenImageUnit_Image2LoRADecode().process(pipe, **embs)["lora"]
|
| 85 |
|
| 86 |
+
lora_name = f"{ulid}.safetensors"
|
| 87 |
+
lora_path = f"loras/{lora_name}"
|
|
|
|
|
|
|
| 88 |
|
| 89 |
save_file(lora, lora_path)
|
| 90 |
|
|
|
|
| 115 |
margin: 0 auto;
|
| 116 |
max-width: 960px;
|
| 117 |
}
|
| 118 |
+
h3{
|
| 119 |
+
text-align: center;
|
| 120 |
+
display:block;
|
| 121 |
+
}
|
| 122 |
"""
|
| 123 |
|
| 124 |
|
|
|
|
| 144 |
with gr.Column():
|
| 145 |
lora_path = gr.Textbox(label="Generated LoRA path",lines=2, interactive=False)
|
| 146 |
lora_download = gr.DownloadButton(label=f"Download LoRA", visible=has_lora)
|
| 147 |
+
with gr.Accordion("Generate Image", open=False):
|
| 148 |
+
gr.Markdown("### After your LoRA is ready, you can try generate image her.")
|
| 149 |
with gr.Row():
|
| 150 |
with gr.Column():
|
| 151 |
prompt = gr.Textbox(
|
|
|
|
| 157 |
# container=False,
|
| 158 |
)
|
| 159 |
|
| 160 |
+
imagen_button = gr.Button("Generate Image", variant="primary")
|
|
|
|
|
|
|
| 161 |
with gr.Accordion("Advanced Settings", open=False):
|
| 162 |
|
| 163 |
negative_prompt = gr.Textbox(
|
static/header.html
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<div style="text-align: center; max-width: 600px; margin: 0 auto;">
|
| 2 |
<h1>
|
| 3 |
-
|
| 4 |
</h1>
|
| 5 |
<div class="grid-container" >
|
| 6 |
<p>
|
|
|
|
| 1 |
<div style="text-align: center; max-width: 600px; margin: 0 auto;">
|
| 2 |
<h1>
|
| 3 |
+
Qwen Image to LoRA
|
| 4 |
</h1>
|
| 5 |
<div class="grid-container" >
|
| 6 |
<p>
|