Update app.py
Browse files
app.py
CHANGED
|
@@ -14,12 +14,16 @@ if hf_token:
|
|
| 14 |
print("✅ Authentifié")
|
| 15 |
|
| 16 |
model_id = "black-forest-labs/FLUX.1-schnell"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
lora_repo = None
|
| 18 |
lora_path = None
|
| 19 |
|
| 20 |
# Styles disponibles
|
| 21 |
STYLES = {
|
| 22 |
-
"Photoréaliste": "
|
| 23 |
"Artistique": "artistic",
|
| 24 |
"Anime": "anime",
|
| 25 |
"3D Render": "3d_render",
|
|
@@ -99,7 +103,8 @@ with gr.Blocks(title="Flux Schnell + LoRA") as demo:
|
|
| 99 |
gr.Markdown("### Charger un LoRA (optionnel)")
|
| 100 |
lora_repo_input = gr.Textbox(
|
| 101 |
label="Repository LoRA",
|
| 102 |
-
placeholder="username/repo-name"
|
|
|
|
| 103 |
)
|
| 104 |
lora_style_dropdown = gr.Dropdown(
|
| 105 |
choices=list(STYLES.keys()),
|
|
@@ -139,9 +144,13 @@ with gr.Blocks(title="Flux Schnell + LoRA") as demo:
|
|
| 139 |
output_image = gr.Image(label="Image générée", type="pil")
|
| 140 |
gr.Markdown("### Conseils")
|
| 141 |
gr.Markdown("""
|
|
|
|
| 142 |
- **Photoréaliste** : Idéal pour portraits et photos réalistes
|
| 143 |
- **Steps recommandés** : 4 pour Schnell (rapide)
|
| 144 |
- **Résolution** : 1024x1024 par défaut, ajustez selon besoin
|
|
|
|
|
|
|
|
|
|
| 145 |
""")
|
| 146 |
|
| 147 |
# Actions
|
|
|
|
| 14 |
print("✅ Authentifié")
|
| 15 |
|
| 16 |
model_id = "black-forest-labs/FLUX.1-schnell"
|
| 17 |
+
|
| 18 |
+
# Repository LoRA par défaut (à adapter selon votre repository)
|
| 19 |
+
DEFAULT_LORA_REPO = "XLabs-AI/flux-RealismLora" # Exemple de repo avec LoRA photoréaliste
|
| 20 |
+
|
| 21 |
lora_repo = None
|
| 22 |
lora_path = None
|
| 23 |
|
| 24 |
# Styles disponibles
|
| 25 |
STYLES = {
|
| 26 |
+
"Photoréaliste": "lora", # Le fichier s'appelle souvent "lora.safetensors"
|
| 27 |
"Artistique": "artistic",
|
| 28 |
"Anime": "anime",
|
| 29 |
"3D Render": "3d_render",
|
|
|
|
| 103 |
gr.Markdown("### Charger un LoRA (optionnel)")
|
| 104 |
lora_repo_input = gr.Textbox(
|
| 105 |
label="Repository LoRA",
|
| 106 |
+
placeholder="username/repo-name",
|
| 107 |
+
value=DEFAULT_LORA_REPO
|
| 108 |
)
|
| 109 |
lora_style_dropdown = gr.Dropdown(
|
| 110 |
choices=list(STYLES.keys()),
|
|
|
|
| 144 |
output_image = gr.Image(label="Image générée", type="pil")
|
| 145 |
gr.Markdown("### Conseils")
|
| 146 |
gr.Markdown("""
|
| 147 |
+
- **Repository LoRA par défaut** : XLabs-AI/flux-RealismLora
|
| 148 |
- **Photoréaliste** : Idéal pour portraits et photos réalistes
|
| 149 |
- **Steps recommandés** : 4 pour Schnell (rapide)
|
| 150 |
- **Résolution** : 1024x1024 par défaut, ajustez selon besoin
|
| 151 |
+
|
| 152 |
+
💡 **Note** : Le repository `black-forest-labs/FLUX.1-schnell` est le modèle de base,
|
| 153 |
+
pas un repository LoRA. Pour utiliser des LoRA, trouvez des repositories dédiés sur HuggingFace.
|
| 154 |
""")
|
| 155 |
|
| 156 |
# Actions
|