Spaces:
Running
Running
File size: 120,938 Bytes
aae35f1 |
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 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 |
2025-05-29 14:50:28,409 - __main__ - INFO - Initializing GradioAutodiffusers
2025-05-29 14:50:28,409 - __main__ - DEBUG - API key found, length: 39
2025-05-29 14:50:28,409 - auto_diffusers - INFO - Initializing AutoDiffusersGenerator
2025-05-29 14:50:28,409 - auto_diffusers - DEBUG - API key length: 39
2025-05-29 14:50:28,409 - auto_diffusers - INFO - Successfully configured Gemini AI model
2025-05-29 14:50:28,409 - hardware_detector - INFO - Initializing HardwareDetector
2025-05-29 14:50:28,409 - hardware_detector - DEBUG - Starting system hardware detection
2025-05-29 14:50:28,409 - hardware_detector - DEBUG - Platform: Darwin, Architecture: arm64
2025-05-29 14:50:28,409 - hardware_detector - DEBUG - CPU cores: 16, Python: 3.11.11
2025-05-29 14:50:28,409 - hardware_detector - DEBUG - Attempting GPU detection via nvidia-smi
2025-05-29 14:50:28,413 - hardware_detector - DEBUG - nvidia-smi not found, no NVIDIA GPU detected
2025-05-29 14:50:28,413 - hardware_detector - DEBUG - Checking PyTorch availability
2025-05-29 14:50:28,856 - hardware_detector - INFO - PyTorch 2.7.0 detected
2025-05-29 14:50:28,856 - hardware_detector - DEBUG - CUDA available: False, MPS available: True
2025-05-29 14:50:28,856 - hardware_detector - INFO - Hardware detection completed successfully
2025-05-29 14:50:28,856 - hardware_detector - DEBUG - Detected specs: {'platform': 'Darwin', 'architecture': 'arm64', 'cpu_count': 16, 'python_version': '3.11.11', 'gpu_info': None, 'cuda_available': False, 'mps_available': True, 'torch_version': '2.7.0'}
2025-05-29 14:50:28,856 - auto_diffusers - INFO - Hardware detector initialized successfully
2025-05-29 14:50:28,856 - __main__ - INFO - AutoDiffusersGenerator initialized successfully
2025-05-29 14:50:28,856 - simple_memory_calculator - INFO - Initializing SimpleMemoryCalculator
2025-05-29 14:50:28,856 - simple_memory_calculator - DEBUG - HuggingFace API initialized
2025-05-29 14:50:28,856 - __main__ - ERROR - Failed to initialize SimpleMemoryCalculator: 'SimpleMemoryCalculator' object has no attribute 'known_models'
2025-05-29 14:52:16,109 - __main__ - INFO - Initializing GradioAutodiffusers
2025-05-29 14:52:16,109 - __main__ - DEBUG - API key found, length: 39
2025-05-29 14:52:16,109 - auto_diffusers - INFO - Initializing AutoDiffusersGenerator
2025-05-29 14:52:16,109 - auto_diffusers - DEBUG - API key length: 39
2025-05-29 14:52:16,109 - auto_diffusers - INFO - Successfully configured Gemini AI model
2025-05-29 14:52:16,109 - hardware_detector - INFO - Initializing HardwareDetector
2025-05-29 14:52:16,109 - hardware_detector - DEBUG - Starting system hardware detection
2025-05-29 14:52:16,109 - hardware_detector - DEBUG - Platform: Darwin, Architecture: arm64
2025-05-29 14:52:16,109 - hardware_detector - DEBUG - CPU cores: 16, Python: 3.11.11
2025-05-29 14:52:16,109 - hardware_detector - DEBUG - Attempting GPU detection via nvidia-smi
2025-05-29 14:52:16,113 - hardware_detector - DEBUG - nvidia-smi not found, no NVIDIA GPU detected
2025-05-29 14:52:16,113 - hardware_detector - DEBUG - Checking PyTorch availability
2025-05-29 14:52:16,551 - hardware_detector - INFO - PyTorch 2.7.0 detected
2025-05-29 14:52:16,551 - hardware_detector - DEBUG - CUDA available: False, MPS available: True
2025-05-29 14:52:16,551 - hardware_detector - INFO - Hardware detection completed successfully
2025-05-29 14:52:16,551 - hardware_detector - DEBUG - Detected specs: {'platform': 'Darwin', 'architecture': 'arm64', 'cpu_count': 16, 'python_version': '3.11.11', 'gpu_info': None, 'cuda_available': False, 'mps_available': True, 'torch_version': '2.7.0'}
2025-05-29 14:52:16,551 - auto_diffusers - INFO - Hardware detector initialized successfully
2025-05-29 14:52:16,551 - __main__ - INFO - AutoDiffusersGenerator initialized successfully
2025-05-29 14:52:16,551 - simple_memory_calculator - INFO - Initializing SimpleMemoryCalculator
2025-05-29 14:52:16,551 - simple_memory_calculator - DEBUG - HuggingFace API initialized
2025-05-29 14:52:16,551 - simple_memory_calculator - DEBUG - Known models in database: 4
2025-05-29 14:52:16,551 - __main__ - INFO - SimpleMemoryCalculator initialized successfully
2025-05-29 14:52:16,551 - __main__ - DEBUG - Default model settings: gemini-2.5-flash-preview-05-20, temp=0.7
2025-05-29 14:52:16,553 - asyncio - DEBUG - Using selector: KqueueSelector
2025-05-29 14:52:16,566 - httpcore.connection - DEBUG - connect_tcp.started host='api.gradio.app' port=443 local_address=None timeout=3 socket_options=None
2025-05-29 14:52:16,572 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): huggingface.co:443
2025-05-29 14:52:16,648 - asyncio - DEBUG - Using selector: KqueueSelector
2025-05-29 14:52:16,683 - httpcore.connection - DEBUG - connect_tcp.started host='localhost' port=7860 local_address=None timeout=None socket_options=None
2025-05-29 14:52:16,684 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x11fb10b50>
2025-05-29 14:52:16,684 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'GET']>
2025-05-29 14:52:16,684 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 14:52:16,684 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'GET']>
2025-05-29 14:52:16,684 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 14:52:16,685 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'GET']>
2025-05-29 14:52:16,685 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'date', b'Thu, 29 May 2025 05:52:16 GMT'), (b'server', b'uvicorn'), (b'content-length', b'4'), (b'content-type', b'application/json')])
2025-05-29 14:52:16,685 - httpx - INFO - HTTP Request: GET http://localhost:7860/gradio_api/startup-events "HTTP/1.1 200 OK"
2025-05-29 14:52:16,685 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'GET']>
2025-05-29 14:52:16,685 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 14:52:16,685 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 14:52:16,685 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 14:52:16,685 - httpcore.connection - DEBUG - close.started
2025-05-29 14:52:16,685 - httpcore.connection - DEBUG - close.complete
2025-05-29 14:52:16,686 - httpcore.connection - DEBUG - connect_tcp.started host='localhost' port=7860 local_address=None timeout=3 socket_options=None
2025-05-29 14:52:16,686 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x11fbd0810>
2025-05-29 14:52:16,686 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'HEAD']>
2025-05-29 14:52:16,686 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 14:52:16,686 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'HEAD']>
2025-05-29 14:52:16,686 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 14:52:16,686 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'HEAD']>
2025-05-29 14:52:16,692 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'date', b'Thu, 29 May 2025 05:52:16 GMT'), (b'server', b'uvicorn'), (b'content-length', b'73070'), (b'content-type', b'text/html; charset=utf-8')])
2025-05-29 14:52:16,692 - httpx - INFO - HTTP Request: HEAD http://localhost:7860/ "HTTP/1.1 200 OK"
2025-05-29 14:52:16,692 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'HEAD']>
2025-05-29 14:52:16,692 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 14:52:16,692 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 14:52:16,692 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 14:52:16,692 - httpcore.connection - DEBUG - close.started
2025-05-29 14:52:16,692 - httpcore.connection - DEBUG - close.complete
2025-05-29 14:52:16,703 - httpcore.connection - DEBUG - connect_tcp.started host='api.gradio.app' port=443 local_address=None timeout=30 socket_options=None
2025-05-29 14:52:16,842 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x11f765050>
2025-05-29 14:52:16,842 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x10b538b90> server_hostname='api.gradio.app' timeout=3
2025-05-29 14:52:16,852 - urllib3.connectionpool - DEBUG - https://huggingface.co:443 "HEAD /api/telemetry/gradio/initiated HTTP/1.1" 200 0
2025-05-29 14:52:16,861 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x11f733390>
2025-05-29 14:52:16,861 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x11fafe960> server_hostname='api.gradio.app' timeout=30
2025-05-29 14:52:17,179 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x11d14c950>
2025-05-29 14:52:17,179 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'GET']>
2025-05-29 14:52:17,180 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 14:52:17,180 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'GET']>
2025-05-29 14:52:17,180 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 14:52:17,180 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'GET']>
2025-05-29 14:52:17,182 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x11f751e10>
2025-05-29 14:52:17,182 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'GET']>
2025-05-29 14:52:17,182 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 14:52:17,182 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'GET']>
2025-05-29 14:52:17,183 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 14:52:17,183 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'GET']>
2025-05-29 14:52:17,340 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 29 May 2025 05:52:17 GMT'), (b'Content-Type', b'text/html; charset=utf-8'), (b'Transfer-Encoding', b'chunked'), (b'Connection', b'keep-alive'), (b'Server', b'nginx/1.18.0'), (b'ContentType', b'application/json'), (b'Access-Control-Allow-Origin', b'*'), (b'Content-Encoding', b'gzip')])
2025-05-29 14:52:17,340 - httpx - INFO - HTTP Request: GET https://api.gradio.app/v3/tunnel-request "HTTP/1.1 200 OK"
2025-05-29 14:52:17,340 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'GET']>
2025-05-29 14:52:17,340 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 14:52:17,340 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 14:52:17,340 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 14:52:17,340 - httpcore.connection - DEBUG - close.started
2025-05-29 14:52:17,340 - httpcore.connection - DEBUG - close.complete
2025-05-29 14:52:17,354 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 29 May 2025 05:52:17 GMT'), (b'Content-Type', b'application/json'), (b'Content-Length', b'21'), (b'Connection', b'keep-alive'), (b'Server', b'nginx/1.18.0'), (b'Access-Control-Allow-Origin', b'*')])
2025-05-29 14:52:17,355 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
2025-05-29 14:52:17,355 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'GET']>
2025-05-29 14:52:17,355 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 14:52:17,355 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 14:52:17,355 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 14:52:17,355 - httpcore.connection - DEBUG - close.started
2025-05-29 14:52:17,355 - httpcore.connection - DEBUG - close.complete
2025-05-29 14:52:18,360 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): huggingface.co:443
2025-05-29 14:52:18,573 - urllib3.connectionpool - DEBUG - https://huggingface.co:443 "HEAD /api/telemetry/gradio/launched HTTP/1.1" 200 0
2025-05-29 15:59:34,212 - __main__ - INFO - Initializing GradioAutodiffusers
2025-05-29 15:59:34,212 - __main__ - DEBUG - API key found, length: 39
2025-05-29 15:59:34,212 - auto_diffusers - INFO - Initializing AutoDiffusersGenerator
2025-05-29 15:59:34,212 - auto_diffusers - DEBUG - API key length: 39
2025-05-29 15:59:34,212 - auto_diffusers - WARNING - Tool calling dependencies not available, running without tools
2025-05-29 15:59:34,212 - hardware_detector - INFO - Initializing HardwareDetector
2025-05-29 15:59:34,212 - hardware_detector - DEBUG - Starting system hardware detection
2025-05-29 15:59:34,212 - hardware_detector - DEBUG - Platform: Darwin, Architecture: arm64
2025-05-29 15:59:34,212 - hardware_detector - DEBUG - CPU cores: 16, Python: 3.11.11
2025-05-29 15:59:34,212 - hardware_detector - DEBUG - Attempting GPU detection via nvidia-smi
2025-05-29 15:59:34,216 - hardware_detector - DEBUG - nvidia-smi not found, no NVIDIA GPU detected
2025-05-29 15:59:34,216 - hardware_detector - DEBUG - Checking PyTorch availability
2025-05-29 15:59:34,645 - hardware_detector - INFO - PyTorch 2.7.0 detected
2025-05-29 15:59:34,646 - hardware_detector - DEBUG - CUDA available: False, MPS available: True
2025-05-29 15:59:34,646 - hardware_detector - INFO - Hardware detection completed successfully
2025-05-29 15:59:34,646 - hardware_detector - DEBUG - Detected specs: {'platform': 'Darwin', 'architecture': 'arm64', 'cpu_count': 16, 'python_version': '3.11.11', 'gpu_info': None, 'cuda_available': False, 'mps_available': True, 'torch_version': '2.7.0'}
2025-05-29 15:59:34,646 - auto_diffusers - INFO - Hardware detector initialized successfully
2025-05-29 15:59:34,646 - __main__ - INFO - AutoDiffusersGenerator initialized successfully
2025-05-29 15:59:34,646 - simple_memory_calculator - INFO - Initializing SimpleMemoryCalculator
2025-05-29 15:59:34,646 - simple_memory_calculator - DEBUG - HuggingFace API initialized
2025-05-29 15:59:34,646 - simple_memory_calculator - DEBUG - Known models in database: 4
2025-05-29 15:59:34,646 - __main__ - INFO - SimpleMemoryCalculator initialized successfully
2025-05-29 15:59:34,646 - __main__ - DEBUG - Default model settings: gemini-2.5-flash-preview-05-20, temp=0.7
2025-05-29 15:59:34,648 - asyncio - DEBUG - Using selector: KqueueSelector
2025-05-29 15:59:34,661 - httpcore.connection - DEBUG - connect_tcp.started host='api.gradio.app' port=443 local_address=None timeout=3 socket_options=None
2025-05-29 15:59:34,667 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): huggingface.co:443
2025-05-29 15:59:34,749 - asyncio - DEBUG - Using selector: KqueueSelector
2025-05-29 15:59:34,784 - httpcore.connection - DEBUG - connect_tcp.started host='localhost' port=7860 local_address=None timeout=None socket_options=None
2025-05-29 15:59:34,785 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x12991f5d0>
2025-05-29 15:59:34,785 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'GET']>
2025-05-29 15:59:34,785 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 15:59:34,785 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'GET']>
2025-05-29 15:59:34,785 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 15:59:34,785 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'GET']>
2025-05-29 15:59:34,785 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'date', b'Thu, 29 May 2025 06:59:34 GMT'), (b'server', b'uvicorn'), (b'content-length', b'4'), (b'content-type', b'application/json')])
2025-05-29 15:59:34,786 - httpx - INFO - HTTP Request: GET http://localhost:7860/gradio_api/startup-events "HTTP/1.1 200 OK"
2025-05-29 15:59:34,786 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'GET']>
2025-05-29 15:59:34,786 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 15:59:34,786 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 15:59:34,786 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 15:59:34,786 - httpcore.connection - DEBUG - close.started
2025-05-29 15:59:34,786 - httpcore.connection - DEBUG - close.complete
2025-05-29 15:59:34,786 - httpcore.connection - DEBUG - connect_tcp.started host='localhost' port=7860 local_address=None timeout=3 socket_options=None
2025-05-29 15:59:34,787 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x1299d57d0>
2025-05-29 15:59:34,787 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'HEAD']>
2025-05-29 15:59:34,787 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 15:59:34,787 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'HEAD']>
2025-05-29 15:59:34,787 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 15:59:34,787 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'HEAD']>
2025-05-29 15:59:34,792 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'date', b'Thu, 29 May 2025 06:59:34 GMT'), (b'server', b'uvicorn'), (b'content-length', b'73058'), (b'content-type', b'text/html; charset=utf-8')])
2025-05-29 15:59:34,792 - httpx - INFO - HTTP Request: HEAD http://localhost:7860/ "HTTP/1.1 200 OK"
2025-05-29 15:59:34,792 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'HEAD']>
2025-05-29 15:59:34,792 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 15:59:34,792 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 15:59:34,792 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 15:59:34,793 - httpcore.connection - DEBUG - close.started
2025-05-29 15:59:34,793 - httpcore.connection - DEBUG - close.complete
2025-05-29 15:59:34,803 - httpcore.connection - DEBUG - connect_tcp.started host='api.gradio.app' port=443 local_address=None timeout=30 socket_options=None
2025-05-29 15:59:34,825 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x11e39d590>
2025-05-29 15:59:34,825 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x10f3209e0> server_hostname='api.gradio.app' timeout=3
2025-05-29 15:59:34,940 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x11e971610>
2025-05-29 15:59:34,940 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x11f5c36e0> server_hostname='api.gradio.app' timeout=30
2025-05-29 15:59:34,971 - urllib3.connectionpool - DEBUG - https://huggingface.co:443 "HEAD /api/telemetry/gradio/initiated HTTP/1.1" 200 0
2025-05-29 15:59:35,099 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x10f31ba90>
2025-05-29 15:59:35,099 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'GET']>
2025-05-29 15:59:35,100 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 15:59:35,100 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'GET']>
2025-05-29 15:59:35,100 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 15:59:35,100 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'GET']>
2025-05-29 15:59:35,222 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x11de99d10>
2025-05-29 15:59:35,222 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'GET']>
2025-05-29 15:59:35,223 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 15:59:35,223 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'GET']>
2025-05-29 15:59:35,223 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 15:59:35,223 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'GET']>
2025-05-29 15:59:35,237 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 29 May 2025 06:59:35 GMT'), (b'Content-Type', b'application/json'), (b'Content-Length', b'21'), (b'Connection', b'keep-alive'), (b'Server', b'nginx/1.18.0'), (b'Access-Control-Allow-Origin', b'*')])
2025-05-29 15:59:35,238 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
2025-05-29 15:59:35,238 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'GET']>
2025-05-29 15:59:35,238 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 15:59:35,238 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 15:59:35,238 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 15:59:35,238 - httpcore.connection - DEBUG - close.started
2025-05-29 15:59:35,239 - httpcore.connection - DEBUG - close.complete
2025-05-29 15:59:35,362 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 29 May 2025 06:59:35 GMT'), (b'Content-Type', b'text/html; charset=utf-8'), (b'Transfer-Encoding', b'chunked'), (b'Connection', b'keep-alive'), (b'Server', b'nginx/1.18.0'), (b'ContentType', b'application/json'), (b'Access-Control-Allow-Origin', b'*'), (b'Content-Encoding', b'gzip')])
2025-05-29 15:59:35,363 - httpx - INFO - HTTP Request: GET https://api.gradio.app/v3/tunnel-request "HTTP/1.1 200 OK"
2025-05-29 15:59:35,363 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'GET']>
2025-05-29 15:59:35,364 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 15:59:35,364 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 15:59:35,364 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 15:59:35,365 - httpcore.connection - DEBUG - close.started
2025-05-29 15:59:35,365 - httpcore.connection - DEBUG - close.complete
2025-05-29 15:59:36,012 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): huggingface.co:443
2025-05-29 15:59:36,260 - urllib3.connectionpool - DEBUG - https://huggingface.co:443 "HEAD /api/telemetry/gradio/launched HTTP/1.1" 200 0
2025-05-29 16:02:12,960 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:12,961 - simple_memory_calculator - INFO - Using known memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:12,961 - simple_memory_calculator - DEBUG - Known data: {'params_billions': 12.0, 'fp16_gb': 24.0, 'inference_fp16_gb': 36.0}
2025-05-29 16:02:12,961 - simple_memory_calculator - INFO - Generating memory recommendations for black-forest-labs/FLUX.1-schnell with 8.0GB VRAM
2025-05-29 16:02:12,961 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:12,962 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:12,962 - simple_memory_calculator - DEBUG - Model memory: 24.0GB, Inference memory: 36.0GB
2025-05-29 16:02:12,962 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:12,962 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:32,785 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:32,785 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:32,785 - simple_memory_calculator - INFO - Generating memory recommendations for black-forest-labs/FLUX.1-schnell with 8.0GB VRAM
2025-05-29 16:02:32,785 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:32,785 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:32,786 - simple_memory_calculator - DEBUG - Model memory: 24.0GB, Inference memory: 36.0GB
2025-05-29 16:02:32,786 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:32,786 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:47,460 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:47,460 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:47,460 - simple_memory_calculator - INFO - Generating memory recommendations for black-forest-labs/FLUX.1-schnell with 8.0GB VRAM
2025-05-29 16:02:47,460 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:47,460 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:47,460 - simple_memory_calculator - DEBUG - Model memory: 24.0GB, Inference memory: 36.0GB
2025-05-29 16:02:47,460 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:47,460 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:52,300 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:52,300 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:52,300 - simple_memory_calculator - INFO - Generating memory recommendations for black-forest-labs/FLUX.1-schnell with 32.0GB VRAM
2025-05-29 16:02:52,300 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:52,300 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:52,300 - simple_memory_calculator - DEBUG - Model memory: 24.0GB, Inference memory: 36.0GB
2025-05-29 16:02:52,300 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:52,300 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:52,452 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:52,452 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:52,452 - simple_memory_calculator - INFO - Generating memory recommendations for black-forest-labs/FLUX.1-schnell with 32.0GB VRAM
2025-05-29 16:02:52,452 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:52,452 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:52,452 - simple_memory_calculator - DEBUG - Model memory: 24.0GB, Inference memory: 36.0GB
2025-05-29 16:02:52,452 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:52,452 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:54,804 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:54,804 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:54,804 - simple_memory_calculator - INFO - Generating memory recommendations for black-forest-labs/FLUX.1-schnell with 32.0GB VRAM
2025-05-29 16:02:54,804 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:54,804 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:54,804 - simple_memory_calculator - DEBUG - Model memory: 24.0GB, Inference memory: 36.0GB
2025-05-29 16:02:54,804 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:54,804 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:54,804 - auto_diffusers - INFO - Starting code generation for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:02:54,804 - auto_diffusers - DEBUG - Parameters: prompt='A cat holding a sign that says hello world...', size=(768, 1360), steps=4
2025-05-29 16:02:54,804 - auto_diffusers - DEBUG - Manual specs: True, Memory analysis provided: True
2025-05-29 16:02:54,804 - auto_diffusers - INFO - Using manual hardware specifications
2025-05-29 16:02:54,804 - auto_diffusers - DEBUG - Manual specs: {'platform': 'Linux', 'architecture': 'manual_input', 'cpu_count': 8, 'python_version': '3.11', 'cuda_available': False, 'mps_available': False, 'torch_version': '2.0+', 'manual_input': True, 'ram_gb': 16, 'user_dtype': None, 'gpu_info': [{'name': 'RTX 5090', 'memory_mb': 32768}]}
2025-05-29 16:02:54,804 - auto_diffusers - DEBUG - GPU detected with 32.0 GB VRAM
2025-05-29 16:02:54,804 - auto_diffusers - INFO - Selected optimization profile: performance
2025-05-29 16:02:54,804 - auto_diffusers - DEBUG - Creating generation prompt for Gemini API
2025-05-29 16:02:54,804 - auto_diffusers - DEBUG - Prompt length: 3456 characters
2025-05-29 16:02:54,804 - auto_diffusers - INFO - Sending request to Gemini API with tool calling enabled
2025-05-29 16:03:10,966 - auto_diffusers - INFO - Successfully received response from Gemini API (no tools used)
2025-05-29 16:03:10,966 - auto_diffusers - DEBUG - Response length: 1710 characters
2025-05-29 16:08:00,894 - __main__ - INFO - Initializing GradioAutodiffusers
2025-05-29 16:08:00,894 - __main__ - DEBUG - API key found, length: 39
2025-05-29 16:08:00,894 - auto_diffusers - INFO - Initializing AutoDiffusersGenerator
2025-05-29 16:08:00,894 - auto_diffusers - DEBUG - API key length: 39
2025-05-29 16:08:00,894 - auto_diffusers - WARNING - Tool calling dependencies not available, running without tools
2025-05-29 16:08:00,894 - hardware_detector - INFO - Initializing HardwareDetector
2025-05-29 16:08:00,894 - hardware_detector - DEBUG - Starting system hardware detection
2025-05-29 16:08:00,894 - hardware_detector - DEBUG - Platform: Darwin, Architecture: arm64
2025-05-29 16:08:00,894 - hardware_detector - DEBUG - CPU cores: 16, Python: 3.11.11
2025-05-29 16:08:00,894 - hardware_detector - DEBUG - Attempting GPU detection via nvidia-smi
2025-05-29 16:08:00,898 - hardware_detector - DEBUG - nvidia-smi not found, no NVIDIA GPU detected
2025-05-29 16:08:00,898 - hardware_detector - DEBUG - Checking PyTorch availability
2025-05-29 16:08:01,310 - hardware_detector - INFO - PyTorch 2.7.0 detected
2025-05-29 16:08:01,310 - hardware_detector - DEBUG - CUDA available: False, MPS available: True
2025-05-29 16:08:01,310 - hardware_detector - INFO - Hardware detection completed successfully
2025-05-29 16:08:01,310 - hardware_detector - DEBUG - Detected specs: {'platform': 'Darwin', 'architecture': 'arm64', 'cpu_count': 16, 'python_version': '3.11.11', 'gpu_info': None, 'cuda_available': False, 'mps_available': True, 'torch_version': '2.7.0'}
2025-05-29 16:08:01,310 - auto_diffusers - INFO - Hardware detector initialized successfully
2025-05-29 16:08:01,310 - __main__ - INFO - AutoDiffusersGenerator initialized successfully
2025-05-29 16:08:01,310 - simple_memory_calculator - INFO - Initializing SimpleMemoryCalculator
2025-05-29 16:08:01,310 - simple_memory_calculator - DEBUG - HuggingFace API initialized
2025-05-29 16:08:01,310 - simple_memory_calculator - DEBUG - Known models in database: 4
2025-05-29 16:08:01,310 - __main__ - INFO - SimpleMemoryCalculator initialized successfully
2025-05-29 16:08:01,310 - __main__ - DEBUG - Default model settings: gemini-2.5-flash-preview-05-20, temp=0.7
2025-05-29 16:08:01,312 - asyncio - DEBUG - Using selector: KqueueSelector
2025-05-29 16:08:01,325 - httpcore.connection - DEBUG - connect_tcp.started host='api.gradio.app' port=443 local_address=None timeout=3 socket_options=None
2025-05-29 16:08:01,325 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): huggingface.co:443
2025-05-29 16:08:01,404 - asyncio - DEBUG - Using selector: KqueueSelector
2025-05-29 16:08:01,439 - httpcore.connection - DEBUG - connect_tcp.started host='localhost' port=7860 local_address=None timeout=None socket_options=None
2025-05-29 16:08:01,440 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x12e540090>
2025-05-29 16:08:01,440 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'GET']>
2025-05-29 16:08:01,440 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 16:08:01,440 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'GET']>
2025-05-29 16:08:01,441 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 16:08:01,441 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'GET']>
2025-05-29 16:08:01,441 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'date', b'Thu, 29 May 2025 07:08:01 GMT'), (b'server', b'uvicorn'), (b'content-length', b'4'), (b'content-type', b'application/json')])
2025-05-29 16:08:01,441 - httpx - INFO - HTTP Request: GET http://localhost:7860/gradio_api/startup-events "HTTP/1.1 200 OK"
2025-05-29 16:08:01,441 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'GET']>
2025-05-29 16:08:01,441 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 16:08:01,441 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 16:08:01,441 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 16:08:01,441 - httpcore.connection - DEBUG - close.started
2025-05-29 16:08:01,441 - httpcore.connection - DEBUG - close.complete
2025-05-29 16:08:01,442 - httpcore.connection - DEBUG - connect_tcp.started host='localhost' port=7860 local_address=None timeout=3 socket_options=None
2025-05-29 16:08:01,442 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x12e541610>
2025-05-29 16:08:01,442 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'HEAD']>
2025-05-29 16:08:01,442 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 16:08:01,442 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'HEAD']>
2025-05-29 16:08:01,442 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 16:08:01,442 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'HEAD']>
2025-05-29 16:08:01,447 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'date', b'Thu, 29 May 2025 07:08:01 GMT'), (b'server', b'uvicorn'), (b'content-length', b'73065'), (b'content-type', b'text/html; charset=utf-8')])
2025-05-29 16:08:01,448 - httpx - INFO - HTTP Request: HEAD http://localhost:7860/ "HTTP/1.1 200 OK"
2025-05-29 16:08:01,448 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'HEAD']>
2025-05-29 16:08:01,448 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 16:08:01,448 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 16:08:01,448 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 16:08:01,448 - httpcore.connection - DEBUG - close.started
2025-05-29 16:08:01,448 - httpcore.connection - DEBUG - close.complete
2025-05-29 16:08:01,459 - httpcore.connection - DEBUG - connect_tcp.started host='api.gradio.app' port=443 local_address=None timeout=30 socket_options=None
2025-05-29 16:08:01,611 - urllib3.connectionpool - DEBUG - https://huggingface.co:443 "HEAD /api/telemetry/gradio/initiated HTTP/1.1" 200 0
2025-05-29 16:08:01,746 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x129d2c510>
2025-05-29 16:08:01,746 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x12e42f6e0> server_hostname='api.gradio.app' timeout=30
2025-05-29 16:08:01,764 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x12a564450>
2025-05-29 16:08:01,764 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x119258a70> server_hostname='api.gradio.app' timeout=3
2025-05-29 16:08:02,034 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x129854a90>
2025-05-29 16:08:02,035 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'GET']>
2025-05-29 16:08:02,035 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 16:08:02,036 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'GET']>
2025-05-29 16:08:02,036 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 16:08:02,036 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'GET']>
2025-05-29 16:08:02,101 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x12a51b310>
2025-05-29 16:08:02,101 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'GET']>
2025-05-29 16:08:02,101 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 16:08:02,101 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'GET']>
2025-05-29 16:08:02,101 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 16:08:02,101 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'GET']>
2025-05-29 16:08:02,186 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 29 May 2025 07:08:02 GMT'), (b'Content-Type', b'text/html; charset=utf-8'), (b'Transfer-Encoding', b'chunked'), (b'Connection', b'keep-alive'), (b'Server', b'nginx/1.18.0'), (b'ContentType', b'application/json'), (b'Access-Control-Allow-Origin', b'*'), (b'Content-Encoding', b'gzip')])
2025-05-29 16:08:02,186 - httpx - INFO - HTTP Request: GET https://api.gradio.app/v3/tunnel-request "HTTP/1.1 200 OK"
2025-05-29 16:08:02,187 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'GET']>
2025-05-29 16:08:02,187 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 16:08:02,187 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 16:08:02,187 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 16:08:02,187 - httpcore.connection - DEBUG - close.started
2025-05-29 16:08:02,187 - httpcore.connection - DEBUG - close.complete
2025-05-29 16:08:02,272 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 29 May 2025 07:08:02 GMT'), (b'Content-Type', b'application/json'), (b'Content-Length', b'21'), (b'Connection', b'keep-alive'), (b'Server', b'nginx/1.18.0'), (b'Access-Control-Allow-Origin', b'*')])
2025-05-29 16:08:02,273 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
2025-05-29 16:08:02,273 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'GET']>
2025-05-29 16:08:02,273 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 16:08:02,273 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 16:08:02,273 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 16:08:02,273 - httpcore.connection - DEBUG - close.started
2025-05-29 16:08:02,273 - httpcore.connection - DEBUG - close.complete
2025-05-29 16:08:02,845 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): huggingface.co:443
2025-05-29 16:08:03,061 - urllib3.connectionpool - DEBUG - https://huggingface.co:443 "HEAD /api/telemetry/gradio/launched HTTP/1.1" 200 0
2025-05-29 16:08:25,941 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:25,942 - simple_memory_calculator - INFO - Using known memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:25,942 - simple_memory_calculator - DEBUG - Known data: {'params_billions': 12.0, 'fp16_gb': 24.0, 'inference_fp16_gb': 36.0}
2025-05-29 16:08:25,942 - simple_memory_calculator - INFO - Generating memory recommendations for black-forest-labs/FLUX.1-schnell with 8.0GB VRAM
2025-05-29 16:08:25,942 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:25,942 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:25,942 - simple_memory_calculator - DEBUG - Model memory: 24.0GB, Inference memory: 36.0GB
2025-05-29 16:08:25,942 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:25,943 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:30,760 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:30,761 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:30,761 - simple_memory_calculator - INFO - Generating memory recommendations for black-forest-labs/FLUX.1-schnell with 8.0GB VRAM
2025-05-29 16:08:30,761 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:30,761 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:30,761 - simple_memory_calculator - DEBUG - Model memory: 24.0GB, Inference memory: 36.0GB
2025-05-29 16:08:30,761 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:30,761 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:37,477 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:37,477 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:37,478 - simple_memory_calculator - INFO - Generating memory recommendations for black-forest-labs/FLUX.1-schnell with 32.0GB VRAM
2025-05-29 16:08:37,478 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:37,478 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:37,478 - simple_memory_calculator - DEBUG - Model memory: 24.0GB, Inference memory: 36.0GB
2025-05-29 16:08:37,480 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:37,480 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:37,527 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:37,527 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:37,527 - simple_memory_calculator - INFO - Generating memory recommendations for black-forest-labs/FLUX.1-schnell with 32.0GB VRAM
2025-05-29 16:08:37,527 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:37,527 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:37,527 - simple_memory_calculator - DEBUG - Model memory: 24.0GB, Inference memory: 36.0GB
2025-05-29 16:08:37,527 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:37,527 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:39,349 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:39,350 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:39,350 - simple_memory_calculator - INFO - Generating memory recommendations for black-forest-labs/FLUX.1-schnell with 32.0GB VRAM
2025-05-29 16:08:39,350 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:39,350 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:39,351 - simple_memory_calculator - DEBUG - Model memory: 24.0GB, Inference memory: 36.0GB
2025-05-29 16:08:39,351 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:39,351 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:39,351 - auto_diffusers - INFO - Starting code generation for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:08:39,351 - auto_diffusers - DEBUG - Parameters: prompt='A cat holding a sign that says hello world...', size=(768, 1360), steps=4
2025-05-29 16:08:39,351 - auto_diffusers - DEBUG - Manual specs: True, Memory analysis provided: True
2025-05-29 16:08:39,351 - auto_diffusers - INFO - Using manual hardware specifications
2025-05-29 16:08:39,351 - auto_diffusers - DEBUG - Manual specs: {'platform': 'Linux', 'architecture': 'manual_input', 'cpu_count': 8, 'python_version': '3.11', 'cuda_available': False, 'mps_available': False, 'torch_version': '2.0+', 'manual_input': True, 'ram_gb': 16, 'user_dtype': None, 'gpu_info': [{'name': 'RTX 5090', 'memory_mb': 32768}]}
2025-05-29 16:08:39,352 - auto_diffusers - DEBUG - GPU detected with 32.0 GB VRAM
2025-05-29 16:08:39,352 - auto_diffusers - INFO - Selected optimization profile: performance
2025-05-29 16:08:39,352 - auto_diffusers - DEBUG - Creating generation prompt for Gemini API
2025-05-29 16:08:39,352 - auto_diffusers - DEBUG - Prompt length: 3456 characters
2025-05-29 16:08:39,352 - auto_diffusers - INFO - ================================================================================
2025-05-29 16:08:39,352 - auto_diffusers - INFO - PROMPT SENT TO GEMINI API:
2025-05-29 16:08:39,352 - auto_diffusers - INFO - ================================================================================
2025-05-29 16:08:39,352 - auto_diffusers - INFO -
You are an expert in optimizing diffusers library code for different hardware configurations.
NOTE: Advanced tool calling features are available when dependencies are installed.
TASK: Generate optimized Python code for running a diffusion model with the following specifications:
- Model: black-forest-labs/FLUX.1-schnell
- Prompt: "A cat holding a sign that says hello world"
- Image size: 768x1360
- Inference steps: 4
HARDWARE SPECIFICATIONS:
- Platform: Linux (manual_input)
- CPU Cores: 8
- CUDA Available: False
- MPS Available: False
- Optimization Profile: performance
- GPU: RTX 5090 (32.0 GB VRAM)
MEMORY ANALYSIS:
- Model Memory Requirements: 36.0 GB (FP16 inference)
- Model Weights Size: 24.0 GB (FP16)
- Memory Recommendation: ⚠️ Model weights fit, enable memory optimizations
- Recommended Precision: float16
- Attention Slicing Recommended: True
- VAE Slicing Recommended: True
OPTIMIZATION REQUIREMENTS:
Please scrape and analyze the latest optimization techniques from this URL: https://huggingface.co/docs/diffusers/main/en/optimization
IMPORTANT: For FLUX.1-schnell models, do NOT include guidance_scale parameter as it's not needed.
Based on the hardware specs and optimization profile, generate Python code that includes:
1. **Memory Optimizations** (if low VRAM):
- Model offloading (enable_model_cpu_offload, enable_sequential_cpu_offload)
- Attention slicing (enable_attention_slicing)
- VAE slicing (enable_vae_slicing)
- Memory efficient attention
2. **Speed Optimizations**:
- Appropriate torch.compile() usage
- Optimal dtype selection (torch.float16, torch.bfloat16)
- Device placement optimization
3. **Hardware-Specific Optimizations**:
- CUDA optimizations for NVIDIA GPUs
- MPS optimizations for Apple Silicon
- CPU fallbacks when needed
4. **Model-Specific Optimizations**:
- Appropriate scheduler selection
- Optimal inference parameters
- Pipeline configuration
5. **Data Type (dtype) Selection**:
- If user specified a dtype, use that exact dtype in the code
- If no dtype specified, automatically select the optimal dtype based on hardware:
* Apple Silicon (MPS): prefer torch.bfloat16
* NVIDIA GPUs: prefer torch.float16 or torch.bfloat16 based on capability
* CPU only: use torch.float32
- Add a comment explaining why that dtype was chosen
IMPORTANT GUIDELINES:
- Include all necessary imports
- Add brief comments explaining optimization choices
- Use the most current and effective optimization techniques
- Ensure code is production-ready
CODE STYLE REQUIREMENTS - GENERATE COMPACT CODE:
- Assign static values directly to function arguments instead of using variables when possible
- Minimize variable declarations - inline values where it improves readability
- Reduce exception handling to essential cases only - assume normal operation
- Use concise, direct code patterns
- Combine operations where logical and readable
- Avoid unnecessary intermediate variables
- Keep code clean and minimal while maintaining functionality
Examples of preferred compact style:
- pipe = Pipeline.from_pretrained("model", torch_dtype=torch.float16) instead of storing dtype in variable
- image = pipe("prompt", num_inference_steps=4, height=768, width=1360) instead of separate variables
- Direct assignment: device = "cuda" if torch.cuda.is_available() else "cpu"
Generate ONLY the Python code, no explanations before or after the code block.
2025-05-29 16:08:39,353 - auto_diffusers - INFO - ================================================================================
2025-05-29 16:08:39,353 - auto_diffusers - INFO - Sending request to Gemini API
2025-05-29 16:08:54,821 - auto_diffusers - INFO - Successfully received response from Gemini API (no tools used)
2025-05-29 16:08:54,821 - auto_diffusers - DEBUG - Response length: 2512 characters
2025-05-29 16:16:14,940 - __main__ - INFO - Initializing GradioAutodiffusers
2025-05-29 16:16:14,940 - __main__ - DEBUG - API key found, length: 39
2025-05-29 16:16:14,940 - auto_diffusers - INFO - Initializing AutoDiffusersGenerator
2025-05-29 16:16:14,940 - auto_diffusers - DEBUG - API key length: 39
2025-05-29 16:16:14,940 - auto_diffusers - WARNING - Tool calling dependencies not available, running without tools
2025-05-29 16:16:14,940 - hardware_detector - INFO - Initializing HardwareDetector
2025-05-29 16:16:14,940 - hardware_detector - DEBUG - Starting system hardware detection
2025-05-29 16:16:14,940 - hardware_detector - DEBUG - Platform: Darwin, Architecture: arm64
2025-05-29 16:16:14,940 - hardware_detector - DEBUG - CPU cores: 16, Python: 3.11.11
2025-05-29 16:16:14,940 - hardware_detector - DEBUG - Attempting GPU detection via nvidia-smi
2025-05-29 16:16:14,943 - hardware_detector - DEBUG - nvidia-smi not found, no NVIDIA GPU detected
2025-05-29 16:16:14,943 - hardware_detector - DEBUG - Checking PyTorch availability
2025-05-29 16:16:15,359 - hardware_detector - INFO - PyTorch 2.7.0 detected
2025-05-29 16:16:15,359 - hardware_detector - DEBUG - CUDA available: False, MPS available: True
2025-05-29 16:16:15,359 - hardware_detector - INFO - Hardware detection completed successfully
2025-05-29 16:16:15,359 - hardware_detector - DEBUG - Detected specs: {'platform': 'Darwin', 'architecture': 'arm64', 'cpu_count': 16, 'python_version': '3.11.11', 'gpu_info': None, 'cuda_available': False, 'mps_available': True, 'torch_version': '2.7.0'}
2025-05-29 16:16:15,359 - auto_diffusers - INFO - Hardware detector initialized successfully
2025-05-29 16:16:15,359 - __main__ - INFO - AutoDiffusersGenerator initialized successfully
2025-05-29 16:16:15,359 - simple_memory_calculator - INFO - Initializing SimpleMemoryCalculator
2025-05-29 16:16:15,359 - simple_memory_calculator - DEBUG - HuggingFace API initialized
2025-05-29 16:16:15,359 - simple_memory_calculator - DEBUG - Known models in database: 4
2025-05-29 16:16:15,359 - __main__ - INFO - SimpleMemoryCalculator initialized successfully
2025-05-29 16:16:15,359 - __main__ - DEBUG - Default model settings: gemini-2.5-flash-preview-05-20, temp=0.7
2025-05-29 16:16:15,362 - asyncio - DEBUG - Using selector: KqueueSelector
2025-05-29 16:16:15,374 - httpcore.connection - DEBUG - connect_tcp.started host='api.gradio.app' port=443 local_address=None timeout=3 socket_options=None
2025-05-29 16:16:15,381 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): huggingface.co:443
2025-05-29 16:16:15,454 - asyncio - DEBUG - Using selector: KqueueSelector
2025-05-29 16:16:15,488 - httpcore.connection - DEBUG - connect_tcp.started host='localhost' port=7860 local_address=None timeout=None socket_options=None
2025-05-29 16:16:15,489 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x130ad4a90>
2025-05-29 16:16:15,489 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'GET']>
2025-05-29 16:16:15,489 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 16:16:15,489 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'GET']>
2025-05-29 16:16:15,489 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 16:16:15,489 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'GET']>
2025-05-29 16:16:15,490 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'date', b'Thu, 29 May 2025 07:16:15 GMT'), (b'server', b'uvicorn'), (b'content-length', b'4'), (b'content-type', b'application/json')])
2025-05-29 16:16:15,490 - httpx - INFO - HTTP Request: GET http://localhost:7860/gradio_api/startup-events "HTTP/1.1 200 OK"
2025-05-29 16:16:15,490 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'GET']>
2025-05-29 16:16:15,490 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 16:16:15,490 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 16:16:15,490 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 16:16:15,490 - httpcore.connection - DEBUG - close.started
2025-05-29 16:16:15,490 - httpcore.connection - DEBUG - close.complete
2025-05-29 16:16:15,490 - httpcore.connection - DEBUG - connect_tcp.started host='localhost' port=7860 local_address=None timeout=3 socket_options=None
2025-05-29 16:16:15,491 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x130ad5e10>
2025-05-29 16:16:15,491 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'HEAD']>
2025-05-29 16:16:15,491 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 16:16:15,491 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'HEAD']>
2025-05-29 16:16:15,491 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 16:16:15,491 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'HEAD']>
2025-05-29 16:16:15,496 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'date', b'Thu, 29 May 2025 07:16:15 GMT'), (b'server', b'uvicorn'), (b'content-length', b'73064'), (b'content-type', b'text/html; charset=utf-8')])
2025-05-29 16:16:15,496 - httpx - INFO - HTTP Request: HEAD http://localhost:7860/ "HTTP/1.1 200 OK"
2025-05-29 16:16:15,496 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'HEAD']>
2025-05-29 16:16:15,496 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 16:16:15,496 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 16:16:15,496 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 16:16:15,496 - httpcore.connection - DEBUG - close.started
2025-05-29 16:16:15,496 - httpcore.connection - DEBUG - close.complete
2025-05-29 16:16:15,507 - httpcore.connection - DEBUG - connect_tcp.started host='api.gradio.app' port=443 local_address=None timeout=30 socket_options=None
2025-05-29 16:16:15,593 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x13047a3d0>
2025-05-29 16:16:15,593 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x13008d250> server_hostname='api.gradio.app' timeout=3
2025-05-29 16:16:15,648 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x124f7acd0>
2025-05-29 16:16:15,648 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x1309cb920> server_hostname='api.gradio.app' timeout=30
2025-05-29 16:16:15,663 - urllib3.connectionpool - DEBUG - https://huggingface.co:443 "HEAD /api/telemetry/gradio/initiated HTTP/1.1" 200 0
2025-05-29 16:16:15,894 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x13093ec50>
2025-05-29 16:16:15,895 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'GET']>
2025-05-29 16:16:15,896 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 16:16:15,896 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'GET']>
2025-05-29 16:16:15,896 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 16:16:15,896 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'GET']>
2025-05-29 16:16:15,930 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x127aef8d0>
2025-05-29 16:16:15,931 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'GET']>
2025-05-29 16:16:15,931 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 16:16:15,931 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'GET']>
2025-05-29 16:16:15,931 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 16:16:15,931 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'GET']>
2025-05-29 16:16:16,047 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 29 May 2025 07:16:16 GMT'), (b'Content-Type', b'application/json'), (b'Content-Length', b'21'), (b'Connection', b'keep-alive'), (b'Server', b'nginx/1.18.0'), (b'Access-Control-Allow-Origin', b'*')])
2025-05-29 16:16:16,047 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
2025-05-29 16:16:16,047 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'GET']>
2025-05-29 16:16:16,048 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 16:16:16,048 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 16:16:16,048 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 16:16:16,048 - httpcore.connection - DEBUG - close.started
2025-05-29 16:16:16,048 - httpcore.connection - DEBUG - close.complete
2025-05-29 16:16:16,073 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 29 May 2025 07:16:16 GMT'), (b'Content-Type', b'text/html; charset=utf-8'), (b'Transfer-Encoding', b'chunked'), (b'Connection', b'keep-alive'), (b'Server', b'nginx/1.18.0'), (b'ContentType', b'application/json'), (b'Access-Control-Allow-Origin', b'*'), (b'Content-Encoding', b'gzip')])
2025-05-29 16:16:16,074 - httpx - INFO - HTTP Request: GET https://api.gradio.app/v3/tunnel-request "HTTP/1.1 200 OK"
2025-05-29 16:16:16,074 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'GET']>
2025-05-29 16:16:16,074 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 16:16:16,074 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 16:16:16,074 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 16:16:16,074 - httpcore.connection - DEBUG - close.started
2025-05-29 16:16:16,074 - httpcore.connection - DEBUG - close.complete
2025-05-29 16:16:16,750 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): huggingface.co:443
2025-05-29 16:16:16,967 - urllib3.connectionpool - DEBUG - https://huggingface.co:443 "HEAD /api/telemetry/gradio/launched HTTP/1.1" 200 0
2025-05-29 16:16:50,011 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:16:50,012 - simple_memory_calculator - INFO - Using known memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:16:50,012 - simple_memory_calculator - DEBUG - Known data: {'params_billions': 12.0, 'fp16_gb': 24.0, 'inference_fp16_gb': 36.0}
2025-05-29 16:16:50,012 - simple_memory_calculator - INFO - Generating memory recommendations for black-forest-labs/FLUX.1-schnell with 8.0GB VRAM
2025-05-29 16:16:50,012 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:16:50,012 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:16:50,012 - simple_memory_calculator - DEBUG - Model memory: 24.0GB, Inference memory: 36.0GB
2025-05-29 16:16:50,012 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:16:50,012 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:16:56,212 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:16:56,212 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:16:56,212 - simple_memory_calculator - INFO - Generating memory recommendations for black-forest-labs/FLUX.1-schnell with 8.0GB VRAM
2025-05-29 16:16:56,212 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:16:56,212 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:16:56,212 - simple_memory_calculator - DEBUG - Model memory: 24.0GB, Inference memory: 36.0GB
2025-05-29 16:16:56,212 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:16:56,212 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:17:00,382 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:17:00,382 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:17:00,383 - simple_memory_calculator - INFO - Generating memory recommendations for black-forest-labs/FLUX.1-schnell with 32.0GB VRAM
2025-05-29 16:17:00,383 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:17:00,383 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:17:00,383 - simple_memory_calculator - DEBUG - Model memory: 24.0GB, Inference memory: 36.0GB
2025-05-29 16:17:00,383 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:17:00,383 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:17:00,534 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:17:00,534 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:17:00,534 - simple_memory_calculator - INFO - Generating memory recommendations for black-forest-labs/FLUX.1-schnell with 32.0GB VRAM
2025-05-29 16:17:00,534 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:17:00,534 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:17:00,534 - simple_memory_calculator - DEBUG - Model memory: 24.0GB, Inference memory: 36.0GB
2025-05-29 16:17:00,534 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:17:00,535 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:17:02,112 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:17:02,112 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:17:02,112 - simple_memory_calculator - INFO - Generating memory recommendations for black-forest-labs/FLUX.1-schnell with 32.0GB VRAM
2025-05-29 16:17:02,112 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:17:02,112 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:17:02,112 - simple_memory_calculator - DEBUG - Model memory: 24.0GB, Inference memory: 36.0GB
2025-05-29 16:17:02,112 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:17:02,112 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:17:02,112 - auto_diffusers - INFO - Starting code generation for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:17:02,112 - auto_diffusers - DEBUG - Parameters: prompt='A cat holding a sign that says hello world...', size=(768, 1360), steps=4
2025-05-29 16:17:02,112 - auto_diffusers - DEBUG - Manual specs: True, Memory analysis provided: True
2025-05-29 16:17:02,112 - auto_diffusers - INFO - Using manual hardware specifications
2025-05-29 16:17:02,112 - auto_diffusers - DEBUG - Manual specs: {'platform': 'Linux', 'architecture': 'manual_input', 'cpu_count': 8, 'python_version': '3.11', 'cuda_available': False, 'mps_available': False, 'torch_version': '2.0+', 'manual_input': True, 'ram_gb': 16, 'user_dtype': None, 'gpu_info': [{'name': 'RTX 5090', 'memory_mb': 32768}]}
2025-05-29 16:17:02,112 - auto_diffusers - DEBUG - GPU detected with 32.0 GB VRAM
2025-05-29 16:17:02,112 - auto_diffusers - INFO - Selected optimization profile: performance
2025-05-29 16:17:02,112 - auto_diffusers - DEBUG - Creating generation prompt for Gemini API
2025-05-29 16:17:02,113 - auto_diffusers - DEBUG - Prompt length: 3456 characters
2025-05-29 16:17:02,113 - auto_diffusers - INFO - ================================================================================
2025-05-29 16:17:02,113 - auto_diffusers - INFO - PROMPT SENT TO GEMINI API:
2025-05-29 16:17:02,113 - auto_diffusers - INFO - ================================================================================
2025-05-29 16:17:02,113 - auto_diffusers - INFO -
You are an expert in optimizing diffusers library code for different hardware configurations.
NOTE: Advanced tool calling features are available when dependencies are installed.
TASK: Generate optimized Python code for running a diffusion model with the following specifications:
- Model: black-forest-labs/FLUX.1-schnell
- Prompt: "A cat holding a sign that says hello world"
- Image size: 768x1360
- Inference steps: 4
HARDWARE SPECIFICATIONS:
- Platform: Linux (manual_input)
- CPU Cores: 8
- CUDA Available: False
- MPS Available: False
- Optimization Profile: performance
- GPU: RTX 5090 (32.0 GB VRAM)
MEMORY ANALYSIS:
- Model Memory Requirements: 36.0 GB (FP16 inference)
- Model Weights Size: 24.0 GB (FP16)
- Memory Recommendation: ⚠️ Model weights fit, enable memory optimizations
- Recommended Precision: float16
- Attention Slicing Recommended: True
- VAE Slicing Recommended: True
OPTIMIZATION REQUIREMENTS:
Please scrape and analyze the latest optimization techniques from this URL: https://huggingface.co/docs/diffusers/main/en/optimization
IMPORTANT: For FLUX.1-schnell models, do NOT include guidance_scale parameter as it's not needed.
Based on the hardware specs and optimization profile, generate Python code that includes:
1. **Memory Optimizations** (if low VRAM):
- Model offloading (enable_model_cpu_offload, enable_sequential_cpu_offload)
- Attention slicing (enable_attention_slicing)
- VAE slicing (enable_vae_slicing)
- Memory efficient attention
2. **Speed Optimizations**:
- Appropriate torch.compile() usage
- Optimal dtype selection (torch.float16, torch.bfloat16)
- Device placement optimization
3. **Hardware-Specific Optimizations**:
- CUDA optimizations for NVIDIA GPUs
- MPS optimizations for Apple Silicon
- CPU fallbacks when needed
4. **Model-Specific Optimizations**:
- Appropriate scheduler selection
- Optimal inference parameters
- Pipeline configuration
5. **Data Type (dtype) Selection**:
- If user specified a dtype, use that exact dtype in the code
- If no dtype specified, automatically select the optimal dtype based on hardware:
* Apple Silicon (MPS): prefer torch.bfloat16
* NVIDIA GPUs: prefer torch.float16 or torch.bfloat16 based on capability
* CPU only: use torch.float32
- Add a comment explaining why that dtype was chosen
IMPORTANT GUIDELINES:
- Include all necessary imports
- Add brief comments explaining optimization choices
- Use the most current and effective optimization techniques
- Ensure code is production-ready
CODE STYLE REQUIREMENTS - GENERATE COMPACT CODE:
- Assign static values directly to function arguments instead of using variables when possible
- Minimize variable declarations - inline values where it improves readability
- Reduce exception handling to essential cases only - assume normal operation
- Use concise, direct code patterns
- Combine operations where logical and readable
- Avoid unnecessary intermediate variables
- Keep code clean and minimal while maintaining functionality
Examples of preferred compact style:
- pipe = Pipeline.from_pretrained("model", torch_dtype=torch.float16) instead of storing dtype in variable
- image = pipe("prompt", num_inference_steps=4, height=768, width=1360) instead of separate variables
- Direct assignment: device = "cuda" if torch.cuda.is_available() else "cpu"
Generate ONLY the Python code, no explanations before or after the code block.
2025-05-29 16:17:02,113 - auto_diffusers - INFO - ================================================================================
2025-05-29 16:17:02,113 - auto_diffusers - INFO - Sending request to Gemini API
2025-05-29 16:17:17,152 - auto_diffusers - INFO - Successfully received response from Gemini API (no tools used)
2025-05-29 16:17:17,153 - auto_diffusers - DEBUG - Response length: 2451 characters
2025-05-29 16:47:23,476 - __main__ - INFO - Initializing GradioAutodiffusers
2025-05-29 16:47:23,476 - __main__ - DEBUG - API key found, length: 39
2025-05-29 16:47:23,476 - auto_diffusers - INFO - Initializing AutoDiffusersGenerator
2025-05-29 16:47:23,476 - auto_diffusers - DEBUG - API key length: 39
2025-05-29 16:47:23,477 - auto_diffusers - WARNING - Tool calling dependencies not available, running without tools
2025-05-29 16:47:23,477 - hardware_detector - INFO - Initializing HardwareDetector
2025-05-29 16:47:23,477 - hardware_detector - DEBUG - Starting system hardware detection
2025-05-29 16:47:23,477 - hardware_detector - DEBUG - Platform: Darwin, Architecture: arm64
2025-05-29 16:47:23,477 - hardware_detector - DEBUG - CPU cores: 16, Python: 3.11.11
2025-05-29 16:47:23,477 - hardware_detector - DEBUG - Attempting GPU detection via nvidia-smi
2025-05-29 16:47:23,480 - hardware_detector - DEBUG - nvidia-smi not found, no NVIDIA GPU detected
2025-05-29 16:47:23,480 - hardware_detector - DEBUG - Checking PyTorch availability
2025-05-29 16:47:23,928 - hardware_detector - INFO - PyTorch 2.7.0 detected
2025-05-29 16:47:23,928 - hardware_detector - DEBUG - CUDA available: False, MPS available: True
2025-05-29 16:47:23,928 - hardware_detector - INFO - Hardware detection completed successfully
2025-05-29 16:47:23,928 - hardware_detector - DEBUG - Detected specs: {'platform': 'Darwin', 'architecture': 'arm64', 'cpu_count': 16, 'python_version': '3.11.11', 'gpu_info': None, 'cuda_available': False, 'mps_available': True, 'torch_version': '2.7.0'}
2025-05-29 16:47:23,928 - auto_diffusers - INFO - Hardware detector initialized successfully
2025-05-29 16:47:23,928 - __main__ - INFO - AutoDiffusersGenerator initialized successfully
2025-05-29 16:47:23,928 - simple_memory_calculator - INFO - Initializing SimpleMemoryCalculator
2025-05-29 16:47:23,928 - simple_memory_calculator - DEBUG - HuggingFace API initialized
2025-05-29 16:47:23,928 - simple_memory_calculator - DEBUG - Known models in database: 4
2025-05-29 16:47:23,928 - __main__ - INFO - SimpleMemoryCalculator initialized successfully
2025-05-29 16:47:23,928 - __main__ - DEBUG - Default model settings: gemini-2.5-flash-preview-05-20, temp=0.7
2025-05-29 16:47:23,930 - asyncio - DEBUG - Using selector: KqueueSelector
2025-05-29 16:47:23,944 - httpcore.connection - DEBUG - connect_tcp.started host='api.gradio.app' port=443 local_address=None timeout=3 socket_options=None
2025-05-29 16:47:23,950 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): huggingface.co:443
2025-05-29 16:47:24,025 - asyncio - DEBUG - Using selector: KqueueSelector
2025-05-29 16:47:24,059 - httpcore.connection - DEBUG - connect_tcp.started host='localhost' port=7860 local_address=None timeout=None socket_options=None
2025-05-29 16:47:24,060 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x129f2bf90>
2025-05-29 16:47:24,060 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'GET']>
2025-05-29 16:47:24,060 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 16:47:24,060 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'GET']>
2025-05-29 16:47:24,061 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 16:47:24,061 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'GET']>
2025-05-29 16:47:24,061 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'date', b'Thu, 29 May 2025 07:47:24 GMT'), (b'server', b'uvicorn'), (b'content-length', b'4'), (b'content-type', b'application/json')])
2025-05-29 16:47:24,061 - httpx - INFO - HTTP Request: GET http://localhost:7860/gradio_api/startup-events "HTTP/1.1 200 OK"
2025-05-29 16:47:24,061 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'GET']>
2025-05-29 16:47:24,061 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 16:47:24,061 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 16:47:24,061 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 16:47:24,061 - httpcore.connection - DEBUG - close.started
2025-05-29 16:47:24,061 - httpcore.connection - DEBUG - close.complete
2025-05-29 16:47:24,062 - httpcore.connection - DEBUG - connect_tcp.started host='localhost' port=7860 local_address=None timeout=3 socket_options=None
2025-05-29 16:47:24,062 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x12cbb3f90>
2025-05-29 16:47:24,062 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'HEAD']>
2025-05-29 16:47:24,062 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 16:47:24,062 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'HEAD']>
2025-05-29 16:47:24,062 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 16:47:24,062 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'HEAD']>
2025-05-29 16:47:24,068 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'date', b'Thu, 29 May 2025 07:47:24 GMT'), (b'server', b'uvicorn'), (b'content-length', b'73064'), (b'content-type', b'text/html; charset=utf-8')])
2025-05-29 16:47:24,068 - httpx - INFO - HTTP Request: HEAD http://localhost:7860/ "HTTP/1.1 200 OK"
2025-05-29 16:47:24,068 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'HEAD']>
2025-05-29 16:47:24,068 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 16:47:24,068 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 16:47:24,068 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 16:47:24,068 - httpcore.connection - DEBUG - close.started
2025-05-29 16:47:24,068 - httpcore.connection - DEBUG - close.complete
2025-05-29 16:47:24,079 - httpcore.connection - DEBUG - connect_tcp.started host='api.gradio.app' port=443 local_address=None timeout=30 socket_options=None
2025-05-29 16:47:24,140 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x12833f750>
2025-05-29 16:47:24,140 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x118154dd0> server_hostname='api.gradio.app' timeout=3
2025-05-29 16:47:24,220 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x1286ce850>
2025-05-29 16:47:24,220 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x12a1cf890> server_hostname='api.gradio.app' timeout=30
2025-05-29 16:47:24,223 - urllib3.connectionpool - DEBUG - https://huggingface.co:443 "HEAD /api/telemetry/gradio/initiated HTTP/1.1" 200 0
2025-05-29 16:47:24,415 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x1280130d0>
2025-05-29 16:47:24,415 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'GET']>
2025-05-29 16:47:24,415 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 16:47:24,415 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'GET']>
2025-05-29 16:47:24,415 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 16:47:24,415 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'GET']>
2025-05-29 16:47:24,504 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x129f29090>
2025-05-29 16:47:24,505 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'GET']>
2025-05-29 16:47:24,505 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 16:47:24,505 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'GET']>
2025-05-29 16:47:24,505 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 16:47:24,505 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'GET']>
2025-05-29 16:47:24,553 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 29 May 2025 07:47:24 GMT'), (b'Content-Type', b'application/json'), (b'Content-Length', b'21'), (b'Connection', b'keep-alive'), (b'Server', b'nginx/1.18.0'), (b'Access-Control-Allow-Origin', b'*')])
2025-05-29 16:47:24,554 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
2025-05-29 16:47:24,554 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'GET']>
2025-05-29 16:47:24,554 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 16:47:24,554 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 16:47:24,554 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 16:47:24,554 - httpcore.connection - DEBUG - close.started
2025-05-29 16:47:24,554 - httpcore.connection - DEBUG - close.complete
2025-05-29 16:47:24,648 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 29 May 2025 07:47:24 GMT'), (b'Content-Type', b'text/html; charset=utf-8'), (b'Transfer-Encoding', b'chunked'), (b'Connection', b'keep-alive'), (b'Server', b'nginx/1.18.0'), (b'ContentType', b'application/json'), (b'Access-Control-Allow-Origin', b'*'), (b'Content-Encoding', b'gzip')])
2025-05-29 16:47:24,648 - httpx - INFO - HTTP Request: GET https://api.gradio.app/v3/tunnel-request "HTTP/1.1 200 OK"
2025-05-29 16:47:24,648 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'GET']>
2025-05-29 16:47:24,648 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 16:47:24,648 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 16:47:24,648 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 16:47:24,649 - httpcore.connection - DEBUG - close.started
2025-05-29 16:47:24,649 - httpcore.connection - DEBUG - close.complete
2025-05-29 16:47:25,332 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): huggingface.co:443
2025-05-29 16:47:25,554 - urllib3.connectionpool - DEBUG - https://huggingface.co:443 "HEAD /api/telemetry/gradio/launched HTTP/1.1" 200 0
2025-05-29 16:47:35,239 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:35,239 - simple_memory_calculator - INFO - Using known memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:35,239 - simple_memory_calculator - DEBUG - Known data: {'params_billions': 12.0, 'fp16_gb': 24.0, 'inference_fp16_gb': 36.0}
2025-05-29 16:47:35,239 - simple_memory_calculator - INFO - Generating memory recommendations for black-forest-labs/FLUX.1-schnell with 8.0GB VRAM
2025-05-29 16:47:35,239 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:35,239 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:35,239 - simple_memory_calculator - DEBUG - Model memory: 24.0GB, Inference memory: 36.0GB
2025-05-29 16:47:35,240 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:35,240 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:40,282 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:40,282 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:40,282 - simple_memory_calculator - INFO - Generating memory recommendations for black-forest-labs/FLUX.1-schnell with 8.0GB VRAM
2025-05-29 16:47:40,282 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:40,282 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:40,282 - simple_memory_calculator - DEBUG - Model memory: 24.0GB, Inference memory: 36.0GB
2025-05-29 16:47:40,282 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:40,282 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:43,895 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:43,895 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:43,895 - simple_memory_calculator - INFO - Generating memory recommendations for black-forest-labs/FLUX.1-schnell with 32.0GB VRAM
2025-05-29 16:47:43,895 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:43,895 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:43,895 - simple_memory_calculator - DEBUG - Model memory: 24.0GB, Inference memory: 36.0GB
2025-05-29 16:47:43,895 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:43,896 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:44,048 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:44,048 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:44,048 - simple_memory_calculator - INFO - Generating memory recommendations for black-forest-labs/FLUX.1-schnell with 32.0GB VRAM
2025-05-29 16:47:44,048 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:44,048 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:44,048 - simple_memory_calculator - DEBUG - Model memory: 24.0GB, Inference memory: 36.0GB
2025-05-29 16:47:44,048 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:44,048 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:48,011 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:48,011 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:48,011 - simple_memory_calculator - INFO - Generating memory recommendations for black-forest-labs/FLUX.1-schnell with 32.0GB VRAM
2025-05-29 16:47:48,011 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:48,011 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:48,011 - simple_memory_calculator - DEBUG - Model memory: 24.0GB, Inference memory: 36.0GB
2025-05-29 16:47:48,011 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:48,012 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:48,012 - auto_diffusers - INFO - Starting code generation for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:47:48,012 - auto_diffusers - DEBUG - Parameters: prompt='A cat holding a sign that says hello world...', size=(768, 1360), steps=4
2025-05-29 16:47:48,012 - auto_diffusers - DEBUG - Manual specs: True, Memory analysis provided: True
2025-05-29 16:47:48,012 - auto_diffusers - INFO - Using manual hardware specifications
2025-05-29 16:47:48,012 - auto_diffusers - DEBUG - Manual specs: {'platform': 'Linux', 'architecture': 'manual_input', 'cpu_count': 8, 'python_version': '3.11', 'cuda_available': False, 'mps_available': False, 'torch_version': '2.0+', 'manual_input': True, 'ram_gb': 16, 'user_dtype': None, 'gpu_info': [{'name': 'RTX 5090', 'memory_mb': 32768}]}
2025-05-29 16:47:48,012 - auto_diffusers - DEBUG - GPU detected with 32.0 GB VRAM
2025-05-29 16:47:48,012 - auto_diffusers - INFO - Selected optimization profile: performance
2025-05-29 16:47:48,012 - auto_diffusers - DEBUG - Creating generation prompt for Gemini API
2025-05-29 16:47:48,012 - auto_diffusers - DEBUG - Prompt length: 7613 characters
2025-05-29 16:47:48,012 - auto_diffusers - INFO - ================================================================================
2025-05-29 16:47:48,012 - auto_diffusers - INFO - PROMPT SENT TO GEMINI API:
2025-05-29 16:47:48,013 - auto_diffusers - INFO - ================================================================================
2025-05-29 16:47:48,013 - auto_diffusers - INFO -
You are an expert in optimizing diffusers library code for different hardware configurations.
NOTE: This system includes curated optimization knowledge from HuggingFace documentation.
TASK: Generate optimized Python code for running a diffusion model with the following specifications:
- Model: black-forest-labs/FLUX.1-schnell
- Prompt: "A cat holding a sign that says hello world"
- Image size: 768x1360
- Inference steps: 4
HARDWARE SPECIFICATIONS:
- Platform: Linux (manual_input)
- CPU Cores: 8
- CUDA Available: False
- MPS Available: False
- Optimization Profile: performance
- GPU: RTX 5090 (32.0 GB VRAM)
MEMORY ANALYSIS:
- Model Memory Requirements: 36.0 GB (FP16 inference)
- Model Weights Size: 24.0 GB (FP16)
- Memory Recommendation: ⚠️ Model weights fit, enable memory optimizations
- Recommended Precision: float16
- Attention Slicing Recommended: True
- VAE Slicing Recommended: True
OPTIMIZATION KNOWLEDGE BASE:
# DIFFUSERS OPTIMIZATION TECHNIQUES
## Memory Optimization Techniques
### 1. Model CPU Offloading
Use `enable_model_cpu_offload()` to move models between GPU and CPU automatically:
```python
pipe.enable_model_cpu_offload()
```
- Saves significant VRAM by keeping only active models on GPU
- Automatic management, no manual intervention needed
- Compatible with all pipelines
### 2. Sequential CPU Offloading
Use `enable_sequential_cpu_offload()` for more aggressive memory saving:
```python
pipe.enable_sequential_cpu_offload()
```
- More memory efficient than model offloading
- Moves models to CPU after each forward pass
- Best for very limited VRAM scenarios
### 3. Attention Slicing
Use `enable_attention_slicing()` to reduce memory during attention computation:
```python
pipe.enable_attention_slicing()
# or specify slice size
pipe.enable_attention_slicing("max") # maximum slicing
pipe.enable_attention_slicing(1) # slice_size = 1
```
- Trades compute time for memory
- Most effective for high-resolution images
- Can be combined with other techniques
### 4. VAE Slicing
Use `enable_vae_slicing()` for large batch processing:
```python
pipe.enable_vae_slicing()
```
- Decodes images one at a time instead of all at once
- Essential for batch sizes > 4
- Minimal performance impact on single images
### 5. VAE Tiling
Use `enable_vae_tiling()` for high-resolution image generation:
```python
pipe.enable_vae_tiling()
```
- Enables 4K+ image generation on 8GB VRAM
- Splits images into overlapping tiles
- Automatically disabled for 512x512 or smaller images
### 6. Memory Efficient Attention (xFormers)
Use `enable_xformers_memory_efficient_attention()` if xFormers is installed:
```python
pipe.enable_xformers_memory_efficient_attention()
```
- Significantly reduces memory usage and improves speed
- Requires xformers library installation
- Compatible with most models
## Performance Optimization Techniques
### 1. Half Precision (FP16/BF16)
Use lower precision for better memory and speed:
```python
# FP16 (widely supported)
pipe = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
# BF16 (better numerical stability, newer hardware)
pipe = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16)
```
- FP16: Halves memory usage, widely supported
- BF16: Better numerical stability, requires newer GPUs
- Essential for most optimization scenarios
### 2. Torch Compile (PyTorch 2.0+)
Use `torch.compile()` for significant speed improvements:
```python
pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
# For some models, compile VAE too:
pipe.vae.decode = torch.compile(pipe.vae.decode, mode="reduce-overhead", fullgraph=True)
```
- 5-50% speed improvement
- Requires PyTorch 2.0+
- First run is slower due to compilation
### 3. Fast Schedulers
Use faster schedulers for fewer steps:
```python
from diffusers import LMSDiscreteScheduler, UniPCMultistepScheduler
# LMS Scheduler (good quality, fast)
pipe.scheduler = LMSDiscreteScheduler.from_config(pipe.scheduler.config)
# UniPC Scheduler (fastest)
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
```
## Hardware-Specific Optimizations
### NVIDIA GPU Optimizations
```python
# Enable Tensor Cores
torch.backends.cudnn.benchmark = True
# Optimal data type for NVIDIA
torch_dtype = torch.float16 # or torch.bfloat16 for RTX 30/40 series
```
### Apple Silicon (MPS) Optimizations
```python
# Use MPS device
device = "mps" if torch.backends.mps.is_available() else "cpu"
pipe = pipe.to(device)
# Recommended dtype for Apple Silicon
torch_dtype = torch.bfloat16 # Better than float16 on Apple Silicon
# Attention slicing often helps on MPS
pipe.enable_attention_slicing()
```
### CPU Optimizations
```python
# Use float32 for CPU
torch_dtype = torch.float32
# Enable optimized attention
pipe.enable_attention_slicing()
```
## Model-Specific Guidelines
### FLUX Models
- Do NOT use guidance_scale parameter (not needed for FLUX)
- Use 4-8 inference steps maximum
- BF16 dtype recommended
- Enable attention slicing for memory optimization
### Stable Diffusion XL
- Enable attention slicing for high resolutions
- Use refiner model sparingly to save memory
- Consider VAE tiling for >1024px images
### Stable Diffusion 1.5/2.1
- Very memory efficient base models
- Can often run without optimizations on 8GB+ VRAM
- Enable VAE slicing for batch processing
## Memory Usage Estimation
- FLUX.1: ~24GB for full precision, ~12GB for FP16
- SDXL: ~7GB for FP16, ~14GB for FP32
- SD 1.5: ~2GB for FP16, ~4GB for FP32
## Optimization Combinations by VRAM
### 24GB+ VRAM (High-end)
```python
pipe = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16)
pipe = pipe.to("cuda")
pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
```
### 12-24GB VRAM (Mid-range)
```python
pipe = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
pipe = pipe.to("cuda")
pipe.enable_model_cpu_offload()
pipe.enable_xformers_memory_efficient_attention()
```
### 8-12GB VRAM (Entry-level)
```python
pipe = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
pipe.enable_sequential_cpu_offload()
pipe.enable_attention_slicing()
pipe.enable_vae_slicing()
pipe.enable_xformers_memory_efficient_attention()
```
### <8GB VRAM (Low-end)
```python
pipe = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
pipe.enable_sequential_cpu_offload()
pipe.enable_attention_slicing("max")
pipe.enable_vae_slicing()
pipe.enable_vae_tiling()
```
IMPORTANT: For FLUX.1-schnell models, do NOT include guidance_scale parameter as it's not needed.
Using the OPTIMIZATION KNOWLEDGE BASE above, generate Python code that:
1. **Selects the best optimization techniques** for the specific hardware profile
2. **Applies appropriate memory optimizations** based on available VRAM
3. **Uses optimal data types** for the target hardware:
- User specified dtype (if provided): Use exactly as specified
- Apple Silicon (MPS): prefer torch.bfloat16
- NVIDIA GPUs: prefer torch.float16 or torch.bfloat16
- CPU only: use torch.float32
4. **Implements hardware-specific optimizations** (CUDA, MPS, CPU)
5. **Follows model-specific guidelines** (e.g., FLUX guidance_scale handling)
IMPORTANT GUIDELINES:
- Reference the OPTIMIZATION KNOWLEDGE BASE to select appropriate techniques
- Include all necessary imports
- Add brief comments explaining optimization choices
- Generate compact, production-ready code
- Inline values where possible for concise code
- Generate ONLY the Python code, no explanations before or after the code block
2025-05-29 16:47:48,013 - auto_diffusers - INFO - ================================================================================
2025-05-29 16:47:48,013 - auto_diffusers - INFO - Sending request to Gemini API
2025-05-29 16:48:09,467 - auto_diffusers - INFO - Successfully received response from Gemini API (no tools used)
2025-05-29 16:48:09,467 - auto_diffusers - DEBUG - Response length: 3996 characters
2025-05-29 16:57:34,668 - __main__ - INFO - Initializing GradioAutodiffusers
2025-05-29 16:57:34,668 - __main__ - DEBUG - API key found, length: 39
2025-05-29 16:57:34,668 - auto_diffusers - INFO - Initializing AutoDiffusersGenerator
2025-05-29 16:57:34,668 - auto_diffusers - DEBUG - API key length: 39
2025-05-29 16:57:34,668 - auto_diffusers - WARNING - Tool calling dependencies not available, running without tools
2025-05-29 16:57:34,668 - hardware_detector - INFO - Initializing HardwareDetector
2025-05-29 16:57:34,668 - hardware_detector - DEBUG - Starting system hardware detection
2025-05-29 16:57:34,668 - hardware_detector - DEBUG - Platform: Darwin, Architecture: arm64
2025-05-29 16:57:34,668 - hardware_detector - DEBUG - CPU cores: 16, Python: 3.11.11
2025-05-29 16:57:34,668 - hardware_detector - DEBUG - Attempting GPU detection via nvidia-smi
2025-05-29 16:57:34,672 - hardware_detector - DEBUG - nvidia-smi not found, no NVIDIA GPU detected
2025-05-29 16:57:34,672 - hardware_detector - DEBUG - Checking PyTorch availability
2025-05-29 16:57:35,129 - hardware_detector - INFO - PyTorch 2.7.0 detected
2025-05-29 16:57:35,129 - hardware_detector - DEBUG - CUDA available: False, MPS available: True
2025-05-29 16:57:35,129 - hardware_detector - INFO - Hardware detection completed successfully
2025-05-29 16:57:35,129 - hardware_detector - DEBUG - Detected specs: {'platform': 'Darwin', 'architecture': 'arm64', 'cpu_count': 16, 'python_version': '3.11.11', 'gpu_info': None, 'cuda_available': False, 'mps_available': True, 'torch_version': '2.7.0'}
2025-05-29 16:57:35,129 - auto_diffusers - INFO - Hardware detector initialized successfully
2025-05-29 16:57:35,129 - __main__ - INFO - AutoDiffusersGenerator initialized successfully
2025-05-29 16:57:35,129 - simple_memory_calculator - INFO - Initializing SimpleMemoryCalculator
2025-05-29 16:57:35,129 - simple_memory_calculator - DEBUG - HuggingFace API initialized
2025-05-29 16:57:35,129 - simple_memory_calculator - DEBUG - Known models in database: 4
2025-05-29 16:57:35,129 - __main__ - INFO - SimpleMemoryCalculator initialized successfully
2025-05-29 16:57:35,129 - __main__ - DEBUG - Default model settings: gemini-2.5-flash-preview-05-20, temp=0.7
2025-05-29 16:57:35,131 - asyncio - DEBUG - Using selector: KqueueSelector
2025-05-29 16:57:35,145 - httpcore.connection - DEBUG - connect_tcp.started host='api.gradio.app' port=443 local_address=None timeout=3 socket_options=None
2025-05-29 16:57:35,145 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): huggingface.co:443
2025-05-29 16:57:35,222 - asyncio - DEBUG - Using selector: KqueueSelector
2025-05-29 16:57:35,257 - httpcore.connection - DEBUG - connect_tcp.started host='localhost' port=7860 local_address=None timeout=None socket_options=None
2025-05-29 16:57:35,257 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x12d2dff90>
2025-05-29 16:57:35,258 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'GET']>
2025-05-29 16:57:35,258 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 16:57:35,258 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'GET']>
2025-05-29 16:57:35,258 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 16:57:35,258 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'GET']>
2025-05-29 16:57:35,258 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'date', b'Thu, 29 May 2025 07:57:35 GMT'), (b'server', b'uvicorn'), (b'content-length', b'4'), (b'content-type', b'application/json')])
2025-05-29 16:57:35,259 - httpx - INFO - HTTP Request: GET http://localhost:7860/gradio_api/startup-events "HTTP/1.1 200 OK"
2025-05-29 16:57:35,259 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'GET']>
2025-05-29 16:57:35,259 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 16:57:35,259 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 16:57:35,259 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 16:57:35,259 - httpcore.connection - DEBUG - close.started
2025-05-29 16:57:35,259 - httpcore.connection - DEBUG - close.complete
2025-05-29 16:57:35,259 - httpcore.connection - DEBUG - connect_tcp.started host='localhost' port=7860 local_address=None timeout=3 socket_options=None
2025-05-29 16:57:35,260 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x12fd72390>
2025-05-29 16:57:35,260 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'HEAD']>
2025-05-29 16:57:35,260 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 16:57:35,260 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'HEAD']>
2025-05-29 16:57:35,260 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 16:57:35,260 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'HEAD']>
2025-05-29 16:57:35,265 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'date', b'Thu, 29 May 2025 07:57:35 GMT'), (b'server', b'uvicorn'), (b'content-length', b'75554'), (b'content-type', b'text/html; charset=utf-8')])
2025-05-29 16:57:35,265 - httpx - INFO - HTTP Request: HEAD http://localhost:7860/ "HTTP/1.1 200 OK"
2025-05-29 16:57:35,265 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'HEAD']>
2025-05-29 16:57:35,265 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 16:57:35,265 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 16:57:35,266 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 16:57:35,266 - httpcore.connection - DEBUG - close.started
2025-05-29 16:57:35,266 - httpcore.connection - DEBUG - close.complete
2025-05-29 16:57:35,276 - httpcore.connection - DEBUG - connect_tcp.started host='api.gradio.app' port=443 local_address=None timeout=30 socket_options=None
2025-05-29 16:57:35,346 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x12be9e610>
2025-05-29 16:57:35,346 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x12bb8d1c0> server_hostname='api.gradio.app' timeout=3
2025-05-29 16:57:35,425 - urllib3.connectionpool - DEBUG - https://huggingface.co:443 "HEAD /api/telemetry/gradio/initiated HTTP/1.1" 200 0
2025-05-29 16:57:35,434 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x12a944910>
2025-05-29 16:57:35,434 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x12fd37890> server_hostname='api.gradio.app' timeout=30
2025-05-29 16:57:35,637 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x12be1f910>
2025-05-29 16:57:35,638 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'GET']>
2025-05-29 16:57:35,638 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 16:57:35,638 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'GET']>
2025-05-29 16:57:35,638 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 16:57:35,638 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'GET']>
2025-05-29 16:57:35,751 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x12b17b850>
2025-05-29 16:57:35,751 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'GET']>
2025-05-29 16:57:35,752 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 16:57:35,752 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'GET']>
2025-05-29 16:57:35,752 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 16:57:35,752 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'GET']>
2025-05-29 16:57:35,786 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 29 May 2025 07:57:35 GMT'), (b'Content-Type', b'application/json'), (b'Content-Length', b'21'), (b'Connection', b'keep-alive'), (b'Server', b'nginx/1.18.0'), (b'Access-Control-Allow-Origin', b'*')])
2025-05-29 16:57:35,787 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
2025-05-29 16:57:35,787 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'GET']>
2025-05-29 16:57:35,787 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 16:57:35,787 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 16:57:35,787 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 16:57:35,787 - httpcore.connection - DEBUG - close.started
2025-05-29 16:57:35,788 - httpcore.connection - DEBUG - close.complete
2025-05-29 16:57:35,912 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 29 May 2025 07:57:35 GMT'), (b'Content-Type', b'text/html; charset=utf-8'), (b'Transfer-Encoding', b'chunked'), (b'Connection', b'keep-alive'), (b'Server', b'nginx/1.18.0'), (b'ContentType', b'application/json'), (b'Access-Control-Allow-Origin', b'*'), (b'Content-Encoding', b'gzip')])
2025-05-29 16:57:35,912 - httpx - INFO - HTTP Request: GET https://api.gradio.app/v3/tunnel-request "HTTP/1.1 200 OK"
2025-05-29 16:57:35,912 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'GET']>
2025-05-29 16:57:35,912 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 16:57:35,912 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 16:57:35,912 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 16:57:35,912 - httpcore.connection - DEBUG - close.started
2025-05-29 16:57:35,912 - httpcore.connection - DEBUG - close.complete
2025-05-29 16:57:36,487 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): huggingface.co:443
2025-05-29 16:57:36,707 - urllib3.connectionpool - DEBUG - https://huggingface.co:443 "HEAD /api/telemetry/gradio/launched HTTP/1.1" 200 0
2025-05-29 16:57:49,246 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:57:49,246 - simple_memory_calculator - INFO - Using known memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:57:49,246 - simple_memory_calculator - DEBUG - Known data: {'params_billions': 12.0, 'fp16_gb': 24.0, 'inference_fp16_gb': 36.0}
2025-05-29 16:57:49,246 - simple_memory_calculator - INFO - Generating memory recommendations for black-forest-labs/FLUX.1-schnell with 8.0GB VRAM
2025-05-29 16:57:49,246 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:57:49,246 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 16:57:49,247 - simple_memory_calculator - DEBUG - Model memory: 24.0GB, Inference memory: 36.0GB
2025-05-29 16:57:49,247 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 16:57:49,247 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 17:00:22,113 - __main__ - INFO - Initializing GradioAutodiffusers
2025-05-29 17:00:22,113 - __main__ - DEBUG - API key found, length: 39
2025-05-29 17:00:22,113 - auto_diffusers - INFO - Initializing AutoDiffusersGenerator
2025-05-29 17:00:22,113 - auto_diffusers - DEBUG - API key length: 39
2025-05-29 17:00:22,113 - auto_diffusers - WARNING - Tool calling dependencies not available, running without tools
2025-05-29 17:00:22,113 - hardware_detector - INFO - Initializing HardwareDetector
2025-05-29 17:00:22,113 - hardware_detector - DEBUG - Starting system hardware detection
2025-05-29 17:00:22,113 - hardware_detector - DEBUG - Platform: Darwin, Architecture: arm64
2025-05-29 17:00:22,113 - hardware_detector - DEBUG - CPU cores: 16, Python: 3.11.11
2025-05-29 17:00:22,113 - hardware_detector - DEBUG - Attempting GPU detection via nvidia-smi
2025-05-29 17:00:22,117 - hardware_detector - DEBUG - nvidia-smi not found, no NVIDIA GPU detected
2025-05-29 17:00:22,117 - hardware_detector - DEBUG - Checking PyTorch availability
2025-05-29 17:00:22,530 - hardware_detector - INFO - PyTorch 2.7.0 detected
2025-05-29 17:00:22,530 - hardware_detector - DEBUG - CUDA available: False, MPS available: True
2025-05-29 17:00:22,530 - hardware_detector - INFO - Hardware detection completed successfully
2025-05-29 17:00:22,530 - hardware_detector - DEBUG - Detected specs: {'platform': 'Darwin', 'architecture': 'arm64', 'cpu_count': 16, 'python_version': '3.11.11', 'gpu_info': None, 'cuda_available': False, 'mps_available': True, 'torch_version': '2.7.0'}
2025-05-29 17:00:22,530 - auto_diffusers - INFO - Hardware detector initialized successfully
2025-05-29 17:00:22,530 - __main__ - INFO - AutoDiffusersGenerator initialized successfully
2025-05-29 17:00:22,530 - simple_memory_calculator - INFO - Initializing SimpleMemoryCalculator
2025-05-29 17:00:22,530 - simple_memory_calculator - DEBUG - HuggingFace API initialized
2025-05-29 17:00:22,530 - simple_memory_calculator - DEBUG - Known models in database: 4
2025-05-29 17:00:22,530 - __main__ - INFO - SimpleMemoryCalculator initialized successfully
2025-05-29 17:00:22,530 - __main__ - DEBUG - Default model settings: gemini-2.5-flash-preview-05-20, temp=0.7
2025-05-29 17:00:22,532 - asyncio - DEBUG - Using selector: KqueueSelector
2025-05-29 17:00:22,545 - httpcore.connection - DEBUG - connect_tcp.started host='api.gradio.app' port=443 local_address=None timeout=3 socket_options=None
2025-05-29 17:00:22,550 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): huggingface.co:443
2025-05-29 17:00:22,624 - asyncio - DEBUG - Using selector: KqueueSelector
2025-05-29 17:00:22,657 - httpcore.connection - DEBUG - connect_tcp.started host='localhost' port=7860 local_address=None timeout=None socket_options=None
2025-05-29 17:00:22,657 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x127bd1190>
2025-05-29 17:00:22,657 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'GET']>
2025-05-29 17:00:22,657 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 17:00:22,658 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'GET']>
2025-05-29 17:00:22,658 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 17:00:22,658 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'GET']>
2025-05-29 17:00:22,658 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'date', b'Thu, 29 May 2025 08:00:22 GMT'), (b'server', b'uvicorn'), (b'content-length', b'4'), (b'content-type', b'application/json')])
2025-05-29 17:00:22,658 - httpx - INFO - HTTP Request: GET http://localhost:7860/gradio_api/startup-events "HTTP/1.1 200 OK"
2025-05-29 17:00:22,658 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'GET']>
2025-05-29 17:00:22,658 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 17:00:22,658 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 17:00:22,658 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 17:00:22,658 - httpcore.connection - DEBUG - close.started
2025-05-29 17:00:22,658 - httpcore.connection - DEBUG - close.complete
2025-05-29 17:00:22,659 - httpcore.connection - DEBUG - connect_tcp.started host='localhost' port=7860 local_address=None timeout=3 socket_options=None
2025-05-29 17:00:22,659 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x127bd2510>
2025-05-29 17:00:22,659 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'HEAD']>
2025-05-29 17:00:22,659 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 17:00:22,659 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'HEAD']>
2025-05-29 17:00:22,659 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 17:00:22,659 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'HEAD']>
2025-05-29 17:00:22,665 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'date', b'Thu, 29 May 2025 08:00:22 GMT'), (b'server', b'uvicorn'), (b'content-length', b'75615'), (b'content-type', b'text/html; charset=utf-8')])
2025-05-29 17:00:22,665 - httpx - INFO - HTTP Request: HEAD http://localhost:7860/ "HTTP/1.1 200 OK"
2025-05-29 17:00:22,665 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'HEAD']>
2025-05-29 17:00:22,665 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 17:00:22,665 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 17:00:22,665 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 17:00:22,665 - httpcore.connection - DEBUG - close.started
2025-05-29 17:00:22,665 - httpcore.connection - DEBUG - close.complete
2025-05-29 17:00:22,676 - httpcore.connection - DEBUG - connect_tcp.started host='api.gradio.app' port=443 local_address=None timeout=30 socket_options=None
2025-05-29 17:00:22,750 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x121dda850>
2025-05-29 17:00:22,750 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x107f2cdd0> server_hostname='api.gradio.app' timeout=3
2025-05-29 17:00:22,815 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x1278afd10>
2025-05-29 17:00:22,815 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x127937890> server_hostname='api.gradio.app' timeout=30
2025-05-29 17:00:22,823 - urllib3.connectionpool - DEBUG - https://huggingface.co:443 "HEAD /api/telemetry/gradio/initiated HTTP/1.1" 200 0
2025-05-29 17:00:23,027 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x123a7e850>
2025-05-29 17:00:23,028 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'GET']>
2025-05-29 17:00:23,028 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 17:00:23,029 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'GET']>
2025-05-29 17:00:23,029 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 17:00:23,029 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'GET']>
2025-05-29 17:00:23,090 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x123a771d0>
2025-05-29 17:00:23,090 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'GET']>
2025-05-29 17:00:23,091 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-05-29 17:00:23,091 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'GET']>
2025-05-29 17:00:23,091 - httpcore.http11 - DEBUG - send_request_body.complete
2025-05-29 17:00:23,091 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'GET']>
2025-05-29 17:00:23,199 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 29 May 2025 08:00:23 GMT'), (b'Content-Type', b'application/json'), (b'Content-Length', b'21'), (b'Connection', b'keep-alive'), (b'Server', b'nginx/1.18.0'), (b'Access-Control-Allow-Origin', b'*')])
2025-05-29 17:00:23,201 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
2025-05-29 17:00:23,201 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'GET']>
2025-05-29 17:00:23,201 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 17:00:23,201 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 17:00:23,201 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 17:00:23,201 - httpcore.connection - DEBUG - close.started
2025-05-29 17:00:23,202 - httpcore.connection - DEBUG - close.complete
2025-05-29 17:00:23,232 - httpcore.http11 - DEBUG - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Thu, 29 May 2025 08:00:23 GMT'), (b'Content-Type', b'text/html; charset=utf-8'), (b'Transfer-Encoding', b'chunked'), (b'Connection', b'keep-alive'), (b'Server', b'nginx/1.18.0'), (b'ContentType', b'application/json'), (b'Access-Control-Allow-Origin', b'*'), (b'Content-Encoding', b'gzip')])
2025-05-29 17:00:23,232 - httpx - INFO - HTTP Request: GET https://api.gradio.app/v3/tunnel-request "HTTP/1.1 200 OK"
2025-05-29 17:00:23,232 - httpcore.http11 - DEBUG - receive_response_body.started request=<Request [b'GET']>
2025-05-29 17:00:23,233 - httpcore.http11 - DEBUG - receive_response_body.complete
2025-05-29 17:00:23,233 - httpcore.http11 - DEBUG - response_closed.started
2025-05-29 17:00:23,233 - httpcore.http11 - DEBUG - response_closed.complete
2025-05-29 17:00:23,233 - httpcore.connection - DEBUG - close.started
2025-05-29 17:00:23,233 - httpcore.connection - DEBUG - close.complete
2025-05-29 17:00:23,883 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): huggingface.co:443
2025-05-29 17:00:24,103 - urllib3.connectionpool - DEBUG - https://huggingface.co:443 "HEAD /api/telemetry/gradio/launched HTTP/1.1" 200 0
2025-05-29 17:00:34,004 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 17:00:34,004 - simple_memory_calculator - INFO - Using known memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 17:00:34,005 - simple_memory_calculator - DEBUG - Known data: {'params_billions': 12.0, 'fp16_gb': 24.0, 'inference_fp16_gb': 36.0}
2025-05-29 17:00:34,005 - simple_memory_calculator - INFO - Generating memory recommendations for black-forest-labs/FLUX.1-schnell with 8.0GB VRAM
2025-05-29 17:00:34,005 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 17:00:34,005 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
2025-05-29 17:00:34,005 - simple_memory_calculator - DEBUG - Model memory: 24.0GB, Inference memory: 36.0GB
2025-05-29 17:00:34,005 - simple_memory_calculator - INFO - Getting memory requirements for model: black-forest-labs/FLUX.1-schnell
2025-05-29 17:00:34,005 - simple_memory_calculator - DEBUG - Using cached memory data for black-forest-labs/FLUX.1-schnell
|