// Negatif promptlu üretim — app'in GERÇEK kodu → ComfyUI → mp3. import 'dart:convert'; import 'dart:io'; import '../lib/comfy/workflow/muzik_workflow.dart'; Future main() async { const base = 'http://127.0.0.1:8188'; final http = HttpClient(); final p = MuzikParametreleri( model: 'ace_step_1.5_turbo_aio.safetensors', tags: 'turkish pop, female vocals, energetic, 120 bpm', negatif: 'low quality, muffled, distorted, noise, boring, sleepy', lyrics: '[verse]\ntest\n[chorus]\nhook', seed: 0, bpm: 120, sureSn: 10, steps: 10, ); final wf = muzikWorkflowOlustur(p); stdout.writeln('negatif node 95: ${wf['95']?['class_type']}'); stdout.writeln('KSampler negative: ${wf['3']['inputs']['negative']}'); Future> post(String y, Map g) async { final i = await http.postUrl(Uri.parse('$base$y')); i.headers.contentType = ContentType.json; i.write(jsonEncode(g)); final c = await i.close(); return jsonDecode(await c.transform(utf8.decoder).join()) as Map; } Future> get(String y) async { final i = await http.getUrl(Uri.parse('$base$y')); final c = await i.close(); return jsonDecode(await c.transform(utf8.decoder).join()) as Map; } final r = await post('/prompt', {'prompt': wf, 'client_id': 'fikoyt-e2eneg'}); if (r['error'] != null) { stdout.writeln('RED: ${jsonEncode(r['error'])}'); exit(1); } final pid = r['prompt_id'] as String; stdout.writeln('prompt_id: $pid'); for (var i = 0; i < 90; i++) { await Future.delayed(const Duration(seconds: 4)); final h = await get('/history/$pid'); final k = h[pid] as Map?; if (k == null) continue; final st = k['status'] as Map?; if (st?['status_str'] == 'error') { stdout.writeln('HATA: ${jsonEncode(st)}'); exit(1); } if (st?['completed'] == true) { stdout.writeln('BASARILI: ${jsonEncode(k['outputs'])}'); exit(0); } } stdout.writeln('ZAMAN ASIMI'); exit(1); }