-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy_to_github.py
More file actions
269 lines (217 loc) · 8.79 KB
/
deploy_to_github.py
File metadata and controls
269 lines (217 loc) · 8.79 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
#!/usr/bin/env python3
"""
Deploy ComfyUI Complete Project to GitHub
Deployer hele ComfyUI mappen til https://github.com/stusseligmini/comfyui.git
"""
import os
import shutil
import subprocess
import sys
from pathlib import Path
def deploy_to_github():
"""Deploy hele prosjektet til GitHub"""
# Konfiguration
repo_url = "https://github.com/stusseligmini/comfyui.git"
current_dir = Path(__file__).parent
deploy_dir = current_dir / "temp_deploy"
print("🚀 DEPLOYING TIL GITHUB...")
print(f"📁 Source: {current_dir}")
print(f"🌐 Target: {repo_url}")
print("="*60)
try:
# 1. Clean up any existing deploy directory
if deploy_dir.exists():
print("🗑️ Cleaning up old deployment...")
shutil.rmtree(deploy_dir)
# 2. Clone repository
print("📥 Cloning repository...")
result = subprocess.run([
"git", "clone", repo_url, str(deploy_dir)
], capture_output=True, text=True)
if result.returncode != 0:
print(f"❌ Git clone failed: {result.stderr}")
return False
# 3. Clear existing files (keep .git)
print("🗑️ Clearing existing files...")
for item in deploy_dir.iterdir():
if item.name != '.git':
if item.is_dir():
shutil.rmtree(item)
else:
item.unlink()
# 4. Copy all files from current directory
print("📋 Copying project files...")
for item in current_dir.iterdir():
if item.name in ['temp_deploy', '.git', '__pycache__']:
continue
dest = deploy_dir / item.name
if item.is_dir():
print(f"📁 Copying directory: {item.name}")
shutil.copytree(item, dest)
else:
print(f"📄 Copying file: {item.name}")
shutil.copy2(item, dest)
# 5. Create/update README
readme_content = f"""# 🎭 ComfyUI Complete Windows Project
## 📁 Full Project Structure
Dette repository inneholder hele ComfyUI Windows setup med:
### 🚀 Features
- ✅ **ComfyUI Portable**: Fullstendig Windows installation
- ✅ **Faceswap Extensions**: ReActor og InsightFace
- ✅ **Instagram Models**: Ferdig konfigurerte LoRAs
- ✅ **Batch Scripts**: Automatiserte start scripts
- ✅ **Python Embedded**: Inkludert Python environment
- ✅ **FFmpeg**: Video processing capabilities
- ✅ **Telegram Bot**: Komplett bot integration
- ✅ **Google Colab**: Cloud-basert versjon
### 📦 Inneholder
```
ComfyUI_windows_portable/
├── ComfyUI/ # Hovedappen
├── python_embeded/ # Python environment
├── models/ # AI modeller
├── bots/ # Telegram bots
├── scripts/ # Automatisering
├── tools/ # Utilities
├── guides/ # Dokumentasjon
├── ffmpeg.zip # Video processing
├── *.bat # Start scripts
├── *.py # Python scripts
├── ComfyUI_Complete_Colab_Notebook.ipynb
└── README.md
```
### 💻 Lokal Setup (Windows)
#### 1. Last ned prosjektet
```bash
git clone https://github.com/stusseligmini/comfyui.git
cd comfyui
```
#### 2. Start ComfyUI
- Dobbeltklikk på `START_COMFYUI_ONLY.bat`
- Eller kjør `ÅPNE_MAPPEN.bat` for oversikt
#### 3. Start Faceswap Bot
- Dobbeltklikk på `START_FACESWAP_BOT.bat`
- Konfigurer Telegram tokens først
### ☁️ Google Colab Setup
#### 1. Last opp notebook
- Gå til [colab.research.google.com](https://colab.research.google.com)
- Last opp `ComfyUI_Complete_Colab_Notebook.ipynb`
#### 2. Kjør setup
- Kjør alle celler i rekkefølge (1-11)
- Last opp referanse ansikt i Cell 7
- Vent på automatisk deployment
#### 3. Bruk Telegram Bot
```
selfie red dress elegant
portrait professional makeup
fashion luxury designer
beach summer blonde
cafe cozy casual
party glamorous evening
```
### 🎯 Telegram Commands
Alle kommandoer på engelsk:
| Kommando | Beskrivelse | Eksempel |
|----------|-------------|----------|
| `selfie` | Casual selfie | `selfie red dress elegant` |
| `portrait` | Professional portrait | `portrait makeup studio lighting` |
| `fashion` | Fashion/editorial | `fashion designer luxury outfit` |
| `beach` | Beach/summer | `beach summer blonde waves` |
| `city` | Urban/street | `city modern fashion style` |
| `cafe` | Cozy lifestyle | `cafe casual chic comfortable` |
| `party` | Glamorous party | `party elegant evening dress` |
| `date` | Romantic date | `date restaurant sophisticated` |
| `workout` | Fitness/gym | `workout athletic sporty` |
| `business` | Professional | `business corporate confident` |
### 💡 Key Features
- **Konsistent Ansikt**: Samme ansikt på alle generasjoner
- **10+ Stiler**: Optimaliserte Instagram foto stiler
- **High Quality**: 30 steps med CodeFormer face restoration
- **Video Support**: FFmpeg for video processing
- **Embedded Python**: Ingen ekstra Python installasjon nødvendig
- **Complete Package**: Alt inkludert for umiddelbar bruk
### 🔧 Avansert Konfigurasjon
#### Telegram Bot Setup
1. **Opprett Bot**:
- Chat med @BotFather på Telegram
- `/newbot` → følg instruksjonene
- Kopier bot token
2. **Finn Chat ID**:
- Chat med @userinfobot
- Kopier din chat ID
3. **Konfigurer**:
- Åpne `bots/telegram_bot_ultimate_working.py`
- Endre `TELEGRAM_BOT_TOKEN` og `TELEGRAM_CHAT_ID`
#### Model Management
- **Checkpoints**: `models/checkpoints/`
- **LoRAs**: `models/loras/`
- **Faceswap**: `models/insightface/`
- **Face Restore**: `models/face_restore/`
#### FFmpeg Setup
- `ffmpeg.zip` inkludert for video processing
- Ekstrahér til ønsket lokasjon hvis nødvendig
### 🌐 Repository
**GitHub**: https://github.com/stusseligmini/comfyui.git
### 📞 Support
Dette er et komplett system for AI bilde generering med konsistent ansikt.
Utviklet med avanserte AI teknikker for høykvalitets resultater.
### 🎭 Om Prosjektet
- **Portable**: Fungerer uten installasjon
- **Complete**: Alt nødvendig inkludert
- **Versatile**: Både lokalt og cloud
- **User-friendly**: Enkel å bruke for alle
---
*Komplett ComfyUI setup med faceswap, Instagram modeller og Telegram bot integration*
"""
with open(deploy_dir / "README.md", "w", encoding="utf-8") as f:
f.write(readme_content)
# 6. Git operations
os.chdir(deploy_dir)
print("🔧 Configuring git...")
subprocess.run(["git", "config", "user.name", "ComfyUI Project"], check=True)
subprocess.run(["git", "config", "user.email", "deploy@comfyui.project"], check=True)
print("📤 Adding all files...")
subprocess.run(["git", "add", "."], check=True)
print("💾 Committing changes...")
result = subprocess.run([
"git", "commit", "-m",
"🚀 Deploy Complete ComfyUI Windows Project - Full Installation with All Features"
], capture_output=True, text=True)
if result.returncode != 0 and "nothing to commit" not in result.stdout:
print(f"⚠️ Commit info: {result.stdout}")
print("🚀 Pushing to GitHub...")
result = subprocess.run(["git", "push", "origin", "main"], capture_output=True, text=True)
if result.returncode != 0:
print(f"❌ Push failed: {result.stderr}")
return False
print("✅ DEPLOYMENT SUCCESSFUL!")
print("="*80)
print(f"🌐 Repository: {repo_url}")
print(f"📖 Complete README.md with all instructions")
print(f"🎭 Full project ready for download and use!")
print(f"📱 Share this link: {repo_url}")
print(f"💻 Windows users can clone and run locally")
print(f"☁️ Cloud users can use the Colab notebook")
print(f"🎬 FFmpeg included for video processing")
print("="*80)
return True
except Exception as e:
print(f"❌ Deployment failed: {e}")
return False
finally:
# Cleanup
os.chdir(current_dir)
if deploy_dir.exists():
print("🧹 Cleaning up...")
shutil.rmtree(deploy_dir)
if __name__ == "__main__":
print("🎭 ComfyUI Complete Project Deployment")
print("📁 Deploying entire project to GitHub...")
print()
success = deploy_to_github()
if success:
print("\n🎉 Deployment completed successfully!")
print("🌐 Your project is now available at: https://github.com/stusseligmini/comfyui.git")
else:
print("\n❌ Deployment failed. Check the errors above.")
input("\nPress Enter to exit...")