File size: 1,771 Bytes
0f62534
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# 5. Component Architecture

### 5.1 New Components

#### KeywordAnalysisService
**Responsibility:** Handle keyword frequency analysis for content planning
**Integration Points:** Integrated with existing content service and API endpoints

**Key Interfaces:**
- analyze_keyword_frequency(keywords: List[str]) -> Dict[str, str]

**Dependencies:**
- **Existing Components:** Uses existing database connection and authentication
- **New Components:** None

**Technology Stack:** Python, existing Flask framework

#### ImageGenerationService (Updated)
**Responsibility:** Handle image generation using FLUX.1-dev instead of Qwen
**Integration Points:** Integrated with existing content service and AI workflow

**Key Interfaces:**
- generate_flux_image(prompt: str, seed: int, dimensions: tuple, guidance_scale: float, inference_steps: int) -> str

**Dependencies:**
- **Existing Components:** Uses existing gradio_client and authentication

- **New Components:** None



**Technology Stack:** Python, gradio_client, existing Flask framework

### 5.2 Component Interaction Diagram
```mermaid

graph TB

    subgraph "Frontend"

        A[Posts Page] --> B[KeywordAnalysisPanel]

        A --> C[ImageGenerationPanel]

        B --> D[KeywordAnalysisService]

        C --> E[ImageGenerationService]

    end

    

    subgraph "Backend API"

        F[app.py] --> G[posts_bp]

        G --> H[content_service]

        G --> I[keyword_analysis_service]

    end

    

    subgraph "AI Services"

        H --> J[FLUX.1-dev via gradio_client]

        I --> K[Existing RSS/Post Data]

    end

    

    subgraph "Database"

        L[Supabase] --> H

        L --> I

    end

    

    D -.-> G

    E -.-> G

    B -.-> D

    C -.-> E

```