Spaces:
Sleeping
Sleeping
Gmagl commited on
Commit ·
c68ea97
1
Parent(s): 6cf4412
Consolidation: Add FastAPI integration, Docker support, and automation endpoints
Browse files- Dockerfile +23 -0
- README.md +8 -51
- api.py +37 -0
- requirements.txt +11 -3
Dockerfile
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
+
|
| 3 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 4 |
+
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
RUN apt-get update && apt-get install -y `
|
| 8 |
+
git `
|
| 9 |
+
ffmpeg `
|
| 10 |
+
libsm6 `
|
| 11 |
+
libxext6 `
|
| 12 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
+
|
| 14 |
+
COPY requirements.txt .
|
| 15 |
+
|
| 16 |
+
RUN pip install --no-cache-dir --upgrade pip && `
|
| 17 |
+
pip install --no-cache-dir -r requirements.txt
|
| 18 |
+
|
| 19 |
+
COPY . .
|
| 20 |
+
|
| 21 |
+
EXPOSE 7860
|
| 22 |
+
|
| 23 |
+
CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860"]
|
README.md
CHANGED
|
@@ -1,55 +1,12 @@
|
|
| 1 |
-
# sofia-rivera-workspace
|
| 2 |
-
Workspace mejorado para Sofia Rivera - Influencer IA con galería + generador de imágenes FLUX. Proyecto de monetización con contenido fitness y
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
## 🚀 Demo en Vivo
|
| 7 |
-
|
| 8 |
-
🌐 **HuggingFace Space**: https://huggingface.co/spaces/GoGma/sofia-rivera-workspace
|
| 9 |
-
|
| 10 |
---
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
- ❤️ 1.93k likes | 100% GRATIS | Mejor fidelidad de ID
|
| 18 |
-
- 📌 Usar trigger words: `img woman` en prompts
|
| 19 |
-
|
| 20 |
-
### 2️⃣ AI-Influencer-Generator (SamurAIGPT) ⭐⭐⭐
|
| 21 |
-
- 🔗 https://github.com/SamurAIGPT/AI-Influencer-Generator
|
| 22 |
-
- 🎯 **Uso**: Sistema completo open-source para crear influencers IA
|
| 23 |
-
- ⭐ 174 stars | MIT License | Text-to-image + Text-to-video
|
| 24 |
-
- 📚 Tutorial: https://medium.com/@anilmatcha/ai-influencer-automation
|
| 25 |
-
|
| 26 |
-
### 3️⃣ OpenArt.AI
|
| 27 |
-
- 🔗 https://openart.ai
|
| 28 |
-
- 🎯 **Uso**: Generación rápida de variaciones
|
| 29 |
-
- 🆓 100% gratis | 20 créditos premium de regalo | Sin tarjeta
|
| 30 |
-
|
| 31 |
-
### 4️⃣ Raphael AI
|
| 32 |
-
- 🔗 https://raphael.app
|
| 33 |
-
- 🎯 **Uso**: Generador sin límites ni registro
|
| 34 |
-
- ♾️ Sin límites | Calidad fotorealista | Múltiples modelos
|
| 35 |
-
|
| 36 |
-
---
|
| 37 |
-
|
| 38 |
-
## 📊 Estado del Proyecto
|
| 39 |
-
|
| 40 |
-
✅ **HuggingFace Space**: Funcionando 100%
|
| 41 |
-
✅ **GitHub Repository**: Sincronizado
|
| 42 |
-
✅ **7 Pestañas**: Galería, Generador, Perfil, Prompts, Monetización, Herramientas, Estadísticas
|
| 43 |
-
✅ **5 Prompts**: Lifestyle, Fitness, Premium, Fashion, Beach
|
| 44 |
-
✅ **4 Modelos AI**: FLUX.1-dev, FLUX.1-schnell, SD-XL, SD-1.5
|
| 45 |
-
|
| 46 |
---
|
| 47 |
|
| 48 |
-
#
|
| 49 |
|
| 50 |
-
|
| 51 |
-
2. 🔄 **EN CURSO**: Generar galería inicial (15-20 imágenes)
|
| 52 |
-
3. 📅 Crear calendario de contenido
|
| 53 |
-
4. 📱 Configurar plataformas (Instagram, OnlyFans, Fansly)
|
| 54 |
-
5. 🤖 Automatizar con n8n workflows
|
| 55 |
-
6. 📈 Implementar analytics y trackingpremium.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: "Sofia Rivera AI Workspace"
|
| 3 |
+
emoji: "📸"
|
| 4 |
+
colorFrom: "indigo"
|
| 5 |
+
colorTo: "pink"
|
| 6 |
+
sdk: "docker"
|
| 7 |
+
pinned: true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
+
# Sofia Rivera AI Workspace
|
| 11 |
|
| 12 |
+
Space consolidado con generación de imágenes, UI Gradio y API FastAPI para automatización.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
api.py
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastapi import FastAPI, BackgroundTasks, HTTPException
|
| 2 |
+
from pydantic import BaseModel
|
| 3 |
+
import gradio as gr
|
| 4 |
+
|
| 5 |
+
app = FastAPI(title="Sofia AI Space")
|
| 6 |
+
|
| 7 |
+
class MessageRequest(BaseModel):
|
| 8 |
+
platform: str
|
| 9 |
+
message: str
|
| 10 |
+
user_id: str
|
| 11 |
+
timestamp: str | None = None
|
| 12 |
+
|
| 13 |
+
class ImageGenerationRequest(BaseModel):
|
| 14 |
+
prompt_type: str
|
| 15 |
+
custom_prompt: str | None = None
|
| 16 |
+
model: str = "FLUX.1-schnell"
|
| 17 |
+
|
| 18 |
+
@app.get("/health")
|
| 19 |
+
async def health():
|
| 20 |
+
return {"status": "ok", "service": "sofia-ai"}
|
| 21 |
+
|
| 22 |
+
@app.post("/webhook/message")
|
| 23 |
+
async def webhook_message(body: MessageRequest, background_tasks: BackgroundTasks):
|
| 24 |
+
background_tasks.add_task(lambda: print(f"[Message] {body.platform}: {body.message}"))
|
| 25 |
+
return {"status": "queued"}
|
| 26 |
+
|
| 27 |
+
@app.post("/api/generate")
|
| 28 |
+
async def api_generate(body: ImageGenerationRequest):
|
| 29 |
+
return {"status": "pending", "message": "Image generation not yet implemented"}
|
| 30 |
+
|
| 31 |
+
# Intenta importar la función de app.py, si no existe usa un placeholder
|
| 32 |
+
try:
|
| 33 |
+
from app import create_interface
|
| 34 |
+
gradio_app = create_interface()
|
| 35 |
+
app = gr.mount_gradio_app(app, gradio_app, path="/")
|
| 36 |
+
except:
|
| 37 |
+
print("Warning: create_interface() not found in app.py. Gradio UI will not be mounted.")
|
requirements.txt
CHANGED
|
@@ -1,14 +1,22 @@
|
|
| 1 |
-
gradio
|
| 2 |
huggingface_hub
|
| 3 |
pillow
|
| 4 |
transformers
|
| 5 |
torch
|
| 6 |
sentence-transformers
|
| 7 |
-
openai-whisper
|
| 8 |
soundfile
|
| 9 |
librosa
|
| 10 |
diffusers
|
| 11 |
insightface
|
| 12 |
onnxruntime
|
| 13 |
opencv-python
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
gradio>=4.0.0
|
| 2 |
huggingface_hub
|
| 3 |
pillow
|
| 4 |
transformers
|
| 5 |
torch
|
| 6 |
sentence-transformers
|
|
|
|
| 7 |
soundfile
|
| 8 |
librosa
|
| 9 |
diffusers
|
| 10 |
insightface
|
| 11 |
onnxruntime
|
| 12 |
opencv-python
|
| 13 |
+
facechain
|
| 14 |
+
fastapi>=0.104.0
|
| 15 |
+
uvicorn[standard]>=0.24.0
|
| 16 |
+
pydantic>=2.0.0
|
| 17 |
+
python-multipart
|
| 18 |
+
aiofiles
|
| 19 |
+
httpx>=0.25.0
|
| 20 |
+
schedule>=1.2.0
|
| 21 |
+
tweepy>=4.14.0
|
| 22 |
+
instagrapi>=2.0.0
|