adbrasi commited on
Commit
6e6f5f7
verified
1 Parent(s): 795bf58

Update image_Studio.sh

Browse files
Files changed (1) hide show
  1. image_Studio.sh +94 -49
image_Studio.sh CHANGED
@@ -55,45 +55,49 @@ DOWNLOAD_FILES=(
55
 
56
  # Custom nodes
57
  CUSTOM_NODES=(
58
- "https://github.com/adbrasi/huggpackreator"
59
- "https://github.com/adbrasi/packreator_processor"
60
- "https://github.com/adbrasi/Packreator_manager"
61
- "https://github.com/adbrasi/cezarsave34"
62
- "https://github.com/adbrasi/pageonetor"
63
- "https://github.com/adbrasi/pakreatorio"
64
- "https://github.com/adbrasi/WaterMark_bumbumzin"
65
- "https://github.com/adbrasi/marcadaguita"
66
- "https://github.com/adbrasi/randomico"
67
- "https://github.com/adbrasi/groqrouter"
68
- "https://github.com/adbrasi/find_charakito"
69
- "https://github.com/adbrasi/randomsizito"
70
- "https://github.com/adbrasi/importex"
71
- "https://github.com/adbrasi/storitadifusita"
72
- "https://github.com/adbrasi/attentionPPM"
73
- "https://github.com/ClownsharkBatwing/RES4LYF"
74
- "https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes"
75
- "https://github.com/sipherxyz/comfyui-art-venture"
76
- "https://github.com/pamparamm/sd-perturbed-attention"
77
- "https://github.com/KoreTeknology/ComfyUI-Universal-Styler"
78
- "https://github.com/WASasquatch/was-node-suite-comfyui"
79
- "https://github.com/chflame163/ComfyUI_LayerStyle"
80
- "https://github.com/ltdrdata/ComfyUI-Impact-Pack"
81
- "https://github.com/pythongosssss/ComfyUI-Custom-Scripts"
82
- "https://github.com/rgthree/rgthree-comfy"
83
- "https://github.com/ssitu/ComfyUI_UltimateSDUpscale"
84
- "https://github.com/adbrasi/Importador"
85
- "https://github.com/adbrasi/GetFirstTag"
86
- "https://github.com/adbrasi/comfydodi"
87
- "https://github.com/omar92/ComfyUI-QualityOfLifeSuit_Omar92"
88
- "https://github.com/Cezarsaint/blacklisto"
89
- "https://github.com/TinyTerra/ComfyUI_tinyterraNodes"
90
- "https://github.com/ltdrdata/ComfyUI-Impact-Subpack"
91
- "https://github.com/Cezarsaint/rand0micoUploaderLoven"
92
- "https://github.com/adbrasi/pixivmosaic"
93
- "https://github.com/adbrasi/futfilter"
94
- "https://github.com/Artificial-Sweetener/comfyui-WhiteRabbit"
95
- "https://github.com/shiimizu/ComfyUI_smZNodes"
96
- "https://github.com/CoreyCorza/ComfyUI-CRZnodes"
 
 
 
 
97
  )
98
 
99
  # Download HuggingFace
@@ -112,9 +116,12 @@ download_hf() {
112
  if command -v hf >/dev/null 2>&1; then
113
  cd "$target_dir"
114
  hf download "$(dirname "$url")" "$(basename "$url")" --local-dir . 2>/dev/null
 
115
  cd - >/dev/null
 
116
  else
117
- wget -q --show-progress -c -O "$target_dir/$filename" "https://huggingface.co/$url"
 
118
  fi
119
  }
120
 
@@ -132,10 +139,13 @@ download_mega() {
132
  # Usar megadl simples sem for莽ar nome
133
  if megadl "$url" 2>/dev/null; then
134
  log_success "Mega download OK"
 
 
135
  else
136
  log_warn "Mega download falhou"
 
 
137
  fi
138
- cd - >/dev/null
139
  }
140
 
141
  # Download normal
@@ -145,7 +155,7 @@ download_file() {
145
  local filename="$3"
146
 
147
  # Adicionar token Civitai se necess谩rio
148
- if [[ "$url" == *"civitai.com"* ]]; then
149
  url="${url}&token=${CIVITAI_TOKEN}"
150
  fi
151
 
@@ -156,20 +166,48 @@ download_file() {
156
 
157
  log_info "Baixando: ${filename:-arquivo}"
158
 
 
159
  if command -v aria2c >/dev/null 2>&1; then
160
- aria2c -c -x 4 -s 4 --console-log-level=warn --dir="$target_dir" --out="$filename" "$url"
161
- elif [ -n "$filename" ]; then
162
- wget -q --show-progress -c -O "$target_dir/$filename" "$url"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163
  else
164
  cd "$target_dir"
165
- wget -q --show-progress -c "$url"
166
  cd - >/dev/null
167
  fi
 
 
 
 
 
 
 
 
 
168
  }
169
 
170
  # Processar downloads
171
  process_downloads() {
 
 
 
172
  for entry in "${DOWNLOAD_FILES[@]}"; do
 
173
  IFS='|' read -r url type filename <<< "$entry"
174
 
175
  # Criar diret贸rio
@@ -178,14 +216,21 @@ process_downloads() {
178
 
179
  # Baixar arquivo
180
  if [[ "$url" == mega://* ]]; then
181
- download_mega "$url" "$target_dir"
182
  elif [[ "$url" == *.huggingface.co/* ]]; then
183
  local hf_path="${url#*huggingface.co/}"
184
- download_hf "$hf_path" "$target_dir" "$filename"
185
  else
186
- download_file "$url" "$target_dir" "$filename"
187
  fi
188
  done
 
 
 
 
 
 
 
189
  }
190
 
191
  # Clone git repo
 
55
 
56
  # Custom nodes
57
  CUSTOM_NODES=(
58
+ "https://github.com/adbrasi/huggpackreator"
59
+ "https://github.com/adbrasi/packreator_processor"
60
+ "https://github.com/adbrasi/Packreator_manager"
61
+ "https://github.com/adbrasi/cezarsave34"
62
+ "https://github.com/adbrasi/pageonetor"
63
+ "https://github.com/adbrasi/pakreatorio"
64
+ "https://github.com/adbrasi/WaterMark_bumbumzin"
65
+ "https://github.com/adbrasi/marcadaguita"
66
+ "https://github.com/adbrasi/randomico"
67
+ "https://github.com/adbrasi/groqrouter"
68
+ "https://github.com/adbrasi/find_charakito"
69
+ "https://github.com/adbrasi/randomsizito"
70
+ "https://github.com/adbrasi/importex"
71
+ "https://github.com/adbrasi/storitadifusita"
72
+ "https://github.com/adbrasi/attentionPPM"
73
+ "https://github.com/ClownsharkBatwing/RES4LYF"
74
+ "https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes"
75
+ "https://github.com/sipherxyz/comfyui-art-venture"
76
+ "https://github.com/pamparamm/sd-perturbed-attention"
77
+ "https://github.com/KoreTeknology/ComfyUI-Universal-Styler"
78
+ "https://github.com/WASasquatch/was-node-suite-comfyui"
79
+ "https://github.com/chflame163/ComfyUI_LayerStyle"
80
+ "https://github.com/ltdrdata/ComfyUI-Impact-Pack"
81
+ "https://github.com/pythongosssss/ComfyUI-Custom-Scripts"
82
+ "https://github.com/rgthree/rgthree-comfy"
83
+ "https://github.com/ssitu/ComfyUI_UltimateSDUpscale"
84
+ "https://github.com/adbrasi/Importador"
85
+ "https://github.com/adbrasi/GetFirstTag"
86
+ "https://github.com/adbrasi/comfydodi"
87
+ "https://github.com/omar92/ComfyUI-QualityOfLifeSuit_Omar92"
88
+ "https://github.com/Cezarsaint/blacklisto"
89
+ "https://github.com/TinyTerra/ComfyUI_tinyterraNodes"
90
+ "https://github.com/ltdrdata/ComfyUI-Impact-Subpack"
91
+ "https://github.com/Cezarsaint/rand0micoUploaderLoven"
92
+ "https://github.com/adbrasi/pixivmosaic"
93
+ "https://github.com/adbrasi/futfilter"
94
+ "https://github.com/Artificial-Sweetener/comfyui-WhiteRabbit"
95
+ "https://github.com/shiimizu/ComfyUI_smZNodes"
96
+ "https://github.com/CoreyCorza/ComfyUI-CRZnodes"
97
+ "https://github.com/ClownsharkBatwing/RES4LYF"
98
+ "https://github.com/ltdrdata/ComfyUI-Impact-Pack"
99
+ "https://github.com/ltdrdata/ComfyUI-Impact-Subpack"
100
+ "https://github.com/rgthree/rgthree-comfy"
101
  )
102
 
103
  # Download HuggingFace
 
116
  if command -v hf >/dev/null 2>&1; then
117
  cd "$target_dir"
118
  hf download "$(dirname "$url")" "$(basename "$url")" --local-dir . 2>/dev/null
119
+ local result=$?
120
  cd - >/dev/null
121
+ return $result
122
  else
123
+ wget -q --show-progress -c -O "$target_dir/$filename" "https://huggingface.co/$url" 2>/dev/null
124
+ return $?
125
  fi
126
  }
127
 
 
139
  # Usar megadl simples sem for莽ar nome
140
  if megadl "$url" 2>/dev/null; then
141
  log_success "Mega download OK"
142
+ cd - >/dev/null
143
+ return 0
144
  else
145
  log_warn "Mega download falhou"
146
+ cd - >/dev/null
147
+ return 1
148
  fi
 
149
  }
150
 
151
  # Download normal
 
155
  local filename="$3"
156
 
157
  # Adicionar token Civitai se necess谩rio
158
+ if [[ "$url" == *"civitai.com"* ]] && [[ "$url" != *"token="* ]]; then
159
  url="${url}&token=${CIVITAI_TOKEN}"
160
  fi
161
 
 
166
 
167
  log_info "Baixando: ${filename:-arquivo}"
168
 
169
+ # Tentar com aria2c primeiro
170
  if command -v aria2c >/dev/null 2>&1; then
171
+ if [ -n "$filename" ]; then
172
+ aria2c -c -x 4 -s 4 --console-log-level=warn --dir="$target_dir" --out="$filename" "$url" 2>/dev/null
173
+ else
174
+ aria2c -c -x 4 -s 4 --console-log-level=warn --dir="$target_dir" "$url" 2>/dev/null
175
+ fi
176
+
177
+ # Se aria2c funcionou, retornar sucesso
178
+ if [ $? -eq 0 ]; then
179
+ return 0
180
+ else
181
+ log_warn "aria2c falhou, tentando wget..."
182
+ fi
183
+ fi
184
+
185
+ # Fallback para wget
186
+ if [ -n "$filename" ]; then
187
+ wget -q --show-progress -c -O "$target_dir/$filename" "$url" 2>/dev/null
188
  else
189
  cd "$target_dir"
190
+ wget -q --show-progress -c "$url" 2>/dev/null
191
  cd - >/dev/null
192
  fi
193
+
194
+ # Verificar resultado do wget
195
+ if [ $? -eq 0 ]; then
196
+ log_success "Download OK com wget"
197
+ return 0
198
+ else
199
+ log_error "Download falhou com aria2c e wget: ${filename:-$url}"
200
+ return 1
201
+ fi
202
  }
203
 
204
  # Processar downloads
205
  process_downloads() {
206
+ local total=0
207
+ local failed=0
208
+
209
  for entry in "${DOWNLOAD_FILES[@]}"; do
210
+ ((total++))
211
  IFS='|' read -r url type filename <<< "$entry"
212
 
213
  # Criar diret贸rio
 
216
 
217
  # Baixar arquivo
218
  if [[ "$url" == mega://* ]]; then
219
+ download_mega "$url" "$target_dir" || ((failed++))
220
  elif [[ "$url" == *.huggingface.co/* ]]; then
221
  local hf_path="${url#*huggingface.co/}"
222
+ download_hf "$hf_path" "$target_dir" "$filename" || ((failed++))
223
  else
224
+ download_file "$url" "$target_dir" "$filename" || ((failed++))
225
  fi
226
  done
227
+
228
+ # Reportar resultado
229
+ if [ $failed -gt 0 ]; then
230
+ log_warn "Downloads: $((total-failed))/$total OK ($failed falharam)"
231
+ else
232
+ log_success "Todos os $total downloads completados!"
233
+ fi
234
  }
235
 
236
  # Clone git repo