Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,7 +26,7 @@ if not os.path.exists(SAVE_DIR):
|
|
| 26 |
|
| 27 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 28 |
repo_id = "black-forest-labs/FLUX.1-dev"
|
| 29 |
-
adapter_id = "
|
| 30 |
|
| 31 |
def load_model_with_retry(max_retries=5):
|
| 32 |
"""
|
|
@@ -177,9 +177,9 @@ def process_uploaded_image(
|
|
| 177 |
|
| 178 |
# 프롬프트가 비어있는 경우 기본 프롬프트 사용
|
| 179 |
if not prompt or prompt.strip() == "":
|
| 180 |
-
prompt = "
|
| 181 |
-
elif "
|
| 182 |
-
prompt = f"
|
| 183 |
|
| 184 |
# 이미지 생성 (img2img)
|
| 185 |
# 참고: 실제 FLUX 모델이 img2img를 지원하는지에 따라 이 부분은 조정 필요
|
|
@@ -206,12 +206,12 @@ def process_uploaded_image(
|
|
| 206 |
###############################################################################
|
| 207 |
|
| 208 |
examples = [
|
| 209 |
-
"
|
| 210 |
-
"
|
| 211 |
-
"
|
| 212 |
-
"
|
| 213 |
-
"
|
| 214 |
-
"
|
| 215 |
]
|
| 216 |
|
| 217 |
css = """
|
|
@@ -424,7 +424,7 @@ with gr.Blocks(css=css, analytics_enabled=False, theme="soft") as demo:
|
|
| 424 |
with gr.Column():
|
| 425 |
gr.HTML('''
|
| 426 |
<div class="main-header">
|
| 427 |
-
<h1>✨ FLUX
|
| 428 |
<p>Community: <a href="https://discord.gg/openfreeai" target="_blank">https://discord.gg/openfreeai</a></p>
|
| 429 |
</div>
|
| 430 |
''')
|
|
@@ -437,7 +437,7 @@ with gr.Blocks(css=css, analytics_enabled=False, theme="soft") as demo:
|
|
| 437 |
with gr.Group(elem_classes="container"):
|
| 438 |
prompt = gr.Textbox(
|
| 439 |
label="Enter your imagination",
|
| 440 |
-
placeholder="Describe your
|
| 441 |
lines=3
|
| 442 |
)
|
| 443 |
|
|
@@ -517,7 +517,7 @@ with gr.Blocks(css=css, analytics_enabled=False, theme="soft") as demo:
|
|
| 517 |
)
|
| 518 |
img2img_prompt = gr.Textbox(
|
| 519 |
label="Optional: Describe additional details",
|
| 520 |
-
placeholder="Add details or leave empty for default
|
| 521 |
lines=2
|
| 522 |
)
|
| 523 |
|
|
|
|
| 26 |
|
| 27 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 28 |
repo_id = "black-forest-labs/FLUX.1-dev"
|
| 29 |
+
adapter_id = "ginipick/flux-lora-eric-cat"
|
| 30 |
|
| 31 |
def load_model_with_retry(max_retries=5):
|
| 32 |
"""
|
|
|
|
| 177 |
|
| 178 |
# 프롬프트가 비어있는 경우 기본 프롬프트 사용
|
| 179 |
if not prompt or prompt.strip() == "":
|
| 180 |
+
prompt = "cat style artwork, high quality, detailed"
|
| 181 |
+
elif "cat" not in prompt.lower() and "studio cat" not in prompt.lower():
|
| 182 |
+
prompt = f"cat style {prompt}, high quality, detailed"
|
| 183 |
|
| 184 |
# 이미지 생성 (img2img)
|
| 185 |
# 참고: 실제 FLUX 모델이 img2img를 지원하는지에 따라 이 부분은 조정 필요
|
|
|
|
| 206 |
###############################################################################
|
| 207 |
|
| 208 |
examples = [
|
| 209 |
+
"cat style futuristic stormtrooper with glossy white armor and a sleek helmet, standing heroically on a lush alien planet, vibrant flowers blooming around, soft sunlight illuminating the scene, a gentle breeze rustling the leaves. The armor reflects the pink and purple hues of the alien sunset, creating an ethereal glow around the figure. [trigger]",
|
| 210 |
+
"cat style wonder woman, she saying \"hello\" in 'speech bubble', her blue costume shining under the sun, surrounded by floating islands with waterfalls, magical sparkles in the air. [trigger]",
|
| 211 |
+
"cat style ancient forest guardian robot, covered in moss and flowering vines, sitting peacefully in a crystal-clear lake. Its gentle eyes glow with soft blue light, while bioluminescent dragonflies dance around its weathered metal frame. Ancient tech symbols on its surface pulse with a gentle rhythm. [trigger]",
|
| 212 |
+
"cat style superhero girl saying \"I will protect you\" in a 'speech bubble', her cape flowing in the wind as she stands on a rooftop at sunset, with city lights beginning to twinkle below. [trigger]",
|
| 213 |
+
"cat style cyber-shrine maiden with flowing holographic robes, performing a ritual dance among floating lanterns and digital cherry blossoms. Her traditional headdress emits soft light patterns, while spirit-like AI constructs swirl around her in elegant patterns. The scene is set in a modern shrine with both ancient wood and sleek chrome elements. [trigger]",
|
| 214 |
+
"cat style robot farmer saying \"Harvest time!\" in 'speech bubble', tending to floating rice paddies in the sky, wearing a traditional straw hat with advanced sensors, surrounded by flying fish that leave trails of sparkles. [trigger]"
|
| 215 |
]
|
| 216 |
|
| 217 |
css = """
|
|
|
|
| 424 |
with gr.Column():
|
| 425 |
gr.HTML('''
|
| 426 |
<div class="main-header">
|
| 427 |
+
<h1>✨ FLUX cat LoRA Generator ✨</h1>
|
| 428 |
<p>Community: <a href="https://discord.gg/openfreeai" target="_blank">https://discord.gg/openfreeai</a></p>
|
| 429 |
</div>
|
| 430 |
''')
|
|
|
|
| 437 |
with gr.Group(elem_classes="container"):
|
| 438 |
prompt = gr.Textbox(
|
| 439 |
label="Enter your imagination",
|
| 440 |
+
placeholder="Describe your cat-style image here...",
|
| 441 |
lines=3
|
| 442 |
)
|
| 443 |
|
|
|
|
| 517 |
)
|
| 518 |
img2img_prompt = gr.Textbox(
|
| 519 |
label="Optional: Describe additional details",
|
| 520 |
+
placeholder="Add details or leave empty for default cat style...",
|
| 521 |
lines=2
|
| 522 |
)
|
| 523 |
|