Repository navigation
Expand file tree
/
Copy pathimg-prompt.html
More file actions
1454 lines (1339 loc) · 66.3 KB
/
Copy pathimg-prompt.html
File metadata and controls
1454 lines (1339 loc) · 66.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
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
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>图片反推提示词 - AI提示词工具 | API排行榜实用工具</title>
<meta name="description" content="上传任意图片,AI 九维智能拆解,一键反推高质量绘图提示词。支持 GPT 生图、Midjourney、Stable Diffusion、Flux 多格式输出,中文英文一键切换,免费使用。">
<meta name="keywords" content="图片反推提示词,AI提示词工具,图生提示词,prompt reverse,Midjourney提示词,Stable Diffusion提示词,GPT Image生图,AI绘图">
<meta name="theme-color" content="#F5F7FA">
<meta name="robots" content="index, follow">
<meta property="og:type" content="website">
<meta property="og:title" content="图片反推提示词 - AI提示词工具 | 实用工具">
<meta property="og:description" content="上传任意图片,AI 九维智能拆解,一键反推高质量绘图提示词,支持 GPT 生图 / Midjourney / SD / Flux 多格式输出。">
<meta property="og:url" content="https://api-rank-lake.vercel.app/img-prompt.html">
<meta property="og:site_name" content="AI API中转站排行榜">
<meta property="og:image" content="https://api-rank-lake.vercel.app/favicon.jpg">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="图片反推提示词 - AI提示词工具 | 实用工具">
<meta name="twitter:description" content="上传任意图片,AI 九维智能拆解,一键反推高质量绘图提示词。">
<link rel="canonical" href="https://api-rank-lake.vercel.app/img-prompt.html">
<link rel="icon" type="image/jpeg" href="favicon.jpg">
<link rel="apple-touch-icon" href="favicon.jpg">
<link rel="manifest" href="manifest.json">
<script>
(function() {
var t = localStorage.getItem('theme') || 'light';
if (t === 'dark') document.documentElement.setAttribute('data-theme', 'dark');
})();
</script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebApplication",
"name": "图片反推提示词工具",
"url": "https://api-rank-lake.vercel.app/img-prompt.html",
"applicationCategory": "UtilitiesApplication",
"operatingSystem": "Web",
"description": "上传任意图片,AI 九维智能拆解,一键反推高质量绘图提示词,支持多格式输出",
"offers": { "@type": "Offer", "price": "0", "priceCurrency": "CNY" },
"isPartOf": {
"@type": "WebSite",
"name": "AI API中转站排行榜",
"url": "https://api-rank-lake.vercel.app/"
}
}
</script>
<style>
:root {
--bg-primary: #F5F7FA;
--bg-secondary: #FFFFFF;
--bg-card: #FFFFFF;
--bg-card-hover: #F0F4F8;
--border: rgba(0, 0, 0, 0.08);
--border-hover: rgba(0, 0, 0, 0.15);
--text-primary: #1A1A2E;
--text-secondary: #6B7280;
--text-muted: #9CA3AF;
--accent: #4A90D9;
--accent-light: #7EC8E3;
--accent-glow: rgba(74, 144, 217, 0.2);
--green: #10B981;
--green-glow: rgba(16, 185, 129, 0.15);
--yellow: #F59E0B;
--red: #EF4444;
--orange: #F97316;
--gradient-purple: #4A90D9;
--gradient-green: #10B981;
--gradient-orange: #F97316;
--gradient-pink: #4A90D9;
--gradient-1: #4A90D9;
--navbar-bg: rgba(255,255,255,0.85);
--bg-grid-line: rgba(74,144,217,0.04);
--shadow: rgba(0,0,0,0.06);
--bg-hover: rgba(74, 144, 217, 0.1);
}
[data-theme="dark"] {
--bg-primary: #0F1117;
--bg-secondary: #1A1D28;
--bg-card: #1A1D28;
--bg-card-hover: #242838;
--bg-hover: rgba(74, 144, 217, 0.1);
--border: rgba(255,255,255,0.08);
--border-hover: rgba(255,255,255,0.18);
--text-primary: #E8EAF0;
--text-secondary: #9CA3AF;
--text-muted: #6B7280;
--accent: #5B9FE8;
--accent-light: #7EC8E3;
--accent-glow: rgba(91, 159, 232, 0.25);
--green: #34D399;
--green-glow: rgba(52, 211, 153, 0.15);
--yellow: #FBBF24;
--red: #F87171;
--orange: #FB923C;
--navbar-bg: rgba(15,17,23,0.85);
--bg-grid-line: rgba(91,159,232,0.05);
--shadow: rgba(0,0,0,0.3);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
background: var(--bg-primary);
color: var(--text-primary);
min-height: 100vh;
line-height: 1.6;
}
/* ===== Navbar ===== */
.navbar {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 100;
padding: 16px 0;
background: var(--navbar-bg);
backdrop-filter: blur(20px);
border-bottom: 1px solid var(--border);
transition: all 0.3s ease;
}
.navbar .container {
display: flex;
align-items: center;
justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-primary); }
.logo-icon {
width: 36px; height: 36px;
background: var(--accent);
border-radius: 10px;
display: flex; align-items: center; justify-content: center;
font-weight: 800; font-size: 16px; color: white;
}
.logo-text { font-weight: 700; font-size: 18px; letter-spacing: -0.5px; }
.logo-text span { color: var(--accent-light); }
.nav-links { display: flex; align-items: center; gap: 32px; list-style: none; }
.nav-links a {
color: var(--text-primary);
text-decoration: none;
font-size: 14px;
font-weight: 500;
padding: 8px 14px;
border-radius: 8px;
transition: all 0.2s;
}
.nav-links a:hover { color: var(--accent); background: var(--bg-hover); text-decoration: none; }
.nav-badge {
background: rgba(74, 144, 217, 0.1);
color: var(--accent);
padding: 4px 10px;
border-radius: 20px;
font-size: 12px;
font-weight: 600;
}
.mobile-menu-btn { display: none; }
.theme-toggle {
display: flex; align-items: center; justify-content: center;
width: 36px; height: 36px;
border: 1px solid var(--border);
border-radius: 10px;
background: var(--bg-card);
cursor: pointer; font-size: 18px;
transition: all 0.2s; flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--accent); background: var(--bg-hover); }
/* Hero */
.hero {
padding: 130px 24px 32px;
text-align: center;
background: linear-gradient(180deg, rgba(74, 144, 217, 0.06) 0%, transparent 100%);
}
.hero-badge {
display: inline-flex; align-items: center; gap: 6px;
padding: 6px 16px;
background: rgba(74, 144, 217, 0.1);
border: 1px solid rgba(74, 144, 217, 0.2);
border-radius: 50px;
font-size: 13px; color: var(--accent);
font-weight: 500; margin-bottom: 20px;
}
.hero h1 { font-size: 34px; font-weight: 800; margin-bottom: 12px; color: var(--text-primary); }
.hero p { font-size: 15px; color: var(--text-secondary); max-width: 640px; margin: 0 auto; }
.hero-back {
display: inline-flex; align-items: center; gap: 6px;
font-size: 13px; color: var(--text-muted);
text-decoration: none; margin-bottom: 18px;
padding: 6px 14px; border-radius: 20px;
border: 1px solid var(--border);
background: var(--bg-card);
transition: all 0.2s;
}
.hero-back:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
/* Main Tool Card */
.tool-section { max-width: 1160px; margin: 20px auto 0; padding: 0 24px 32px; }
.tool-card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 20px;
overflow: hidden;
box-shadow: 0 8px 40px var(--shadow);
}
.tool-body {
display: grid;
grid-template-columns: 420px 1fr;
min-height: 560px;
}
/* Left: inputs */
.tool-inputs {
padding: 22px;
border-right: 1px solid var(--border);
display: flex;
flex-direction: column;
gap: 14px;
}
.field label.flabel {
display: block;
font-size: 12px;
font-weight: 600;
color: var(--text-secondary);
text-transform: uppercase;
letter-spacing: 0.5px;
margin-bottom: 6px;
}
/* Upload zone */
.dropzone {
border: 2px dashed var(--border);
border-radius: 14px;
padding: 26px 16px;
text-align: center;
cursor: pointer;
transition: all 0.2s;
background: var(--bg-secondary);
position: relative;
overflow: hidden;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: rgba(74,144,217,0.05); }
.dropzone .dz-icon { font-size: 34px; margin-bottom: 8px; }
.dropzone .dz-main { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.dropzone .dz-sub { font-size: 12px; color: var(--text-muted); }
.dropzone img.preview {
max-width: 100%; max-height: 180px;
border-radius: 10px;
display: block; margin: 0 auto;
}
.dz-remove {
position: absolute; top: 10px; right: 10px;
width: 28px; height: 28px;
border-radius: 50%;
border: none; cursor: pointer;
background: rgba(239,68,68,0.9);
color: #fff; font-size: 14px; line-height: 1;
display: none;
align-items: center; justify-content: center;
}
.dz-remove:hover { background: var(--red); }
.url-row { display: flex; gap: 8px; }
.url-row input { flex: 1; }
input[type="text"], input[type="password"], select, textarea {
width: 100%;
padding: 10px 12px;
background: var(--bg-secondary);
border: 1px solid var(--border);
border-radius: 10px;
color: var(--text-primary);
font-size: 13px;
transition: border-color 0.2s;
font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.row-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* Format chips */
.fmt-chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.fmt-chip {
padding: 9px 4px;
background: var(--bg-secondary);
border: 1px solid var(--border);
border-radius: 10px;
text-align: center;
cursor: pointer;
font-size: 16px;
transition: all 0.2s;
user-select: none;
}
.fmt-chip small {
display: block;
font-size: 10px;
color: var(--text-muted);
margin-top: 2px;
font-weight: 600;
transform: scale(0.9);
}
.fmt-chip:hover { border-color: var(--accent); }
.fmt-chip.active {
background: var(--gradient-purple);
border-color: transparent;
color: #fff;
}
.fmt-chip.active small { color: rgba(255,255,255,0.85); }
/* API settings */
.api-box {
background: var(--bg-secondary);
border: 1px solid var(--border);
border-radius: 12px;
padding: 12px;
display: flex;
flex-direction: column;
gap: 10px;
}
.api-head {
display: flex; justify-content: space-between; align-items: center;
font-size: 12px; font-weight: 700; color: var(--text-secondary);
}
.api-head .hint { font-weight: 500; color: var(--text-muted); font-size: 11px; }
.key-row { display: flex; gap: 8px; }
.key-row input { flex: 1; }
.btn-mini {
padding: 10px 12px;
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 10px;
cursor: pointer;
font-size: 14px;
transition: all 0.2s;
flex-shrink: 0;
}
.btn-mini:hover { border-color: var(--accent); }
.checkbox-label {
display: flex; align-items: center; gap: 6px;
font-size: 12px; color: var(--text-muted); cursor: pointer;
}
.checkbox-label input { accent-color: var(--accent); }
.key-status { font-size: 11px; min-height: 15px; }
.key-status.ok { color: var(--green); }
.key-status.err { color: var(--red); }
/* Generate button */
.gen-btn {
width: 100%;
padding: 13px;
background: var(--gradient-purple);
border: none;
border-radius: 12px;
color: #fff;
font-size: 15px;
font-weight: 600;
cursor: pointer;
transition: all 0.25s;
display: flex; align-items: center; justify-content: center; gap: 8px;
margin-top: 2px;
}
.gen-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 20px var(--accent-glow); }
.gen-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.gen-btn.stop { background: var(--red); }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }
/* Right: output */
.tool-output {
padding: 22px;
display: flex;
flex-direction: column;
gap: 14px;
}
.output-head {
display: flex; justify-content: space-between; align-items: center;
font-size: 12px; font-weight: 600; color: var(--text-secondary);
text-transform: uppercase; letter-spacing: 0.5px;
}
.output-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-act {
padding: 7px 14px;
background: var(--bg-secondary);
border: 1px solid var(--border);
border-radius: 9px;
color: var(--text-secondary);
font-size: 12px;
cursor: pointer;
transition: all 0.2s;
display: inline-flex; align-items: center; gap: 5px;
}
.btn-act:hover { border-color: var(--accent); color: var(--accent); }
.btn-act:disabled { opacity: 0.45; cursor: not-allowed; }
.empty-state {
flex: 1;
display: flex; flex-direction: column;
align-items: center; justify-content: center;
gap: 10px;
color: var(--text-muted);
border: 1px dashed var(--border);
border-radius: 14px;
padding: 40px 20px;
text-align: center;
}
.empty-state .es-icon { font-size: 40px; }
.empty-state .es-title { font-size: 15px; font-weight: 600; color: var(--text-secondary); }
.empty-state .es-sub { font-size: 12px; max-width: 360px; }
.stream-box {
flex: 1;
background: var(--bg-secondary);
border: 1px solid var(--border);
border-radius: 14px;
padding: 18px;
font-size: 13px;
line-height: 1.8;
white-space: pre-wrap;
word-break: break-word;
overflow-y: auto;
max-height: 420px;
display: none;
font-family: 'Inter', -apple-system, sans-serif;
}
.stream-box.streaming { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.prompt-boxes { display: none; flex-direction: column; gap: 12px; }
.prompt-box {
background: var(--bg-secondary);
border: 1px solid var(--border);
border-radius: 12px;
padding: 14px 16px;
}
.prompt-box .pb-head {
display: flex; justify-content: space-between; align-items: center;
margin-bottom: 8px;
}
.prompt-box .pb-title { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.prompt-box.pos .pb-title { color: var(--green); }
.prompt-box.neg .pb-title { color: var(--red); }
.pb-copy {
font-size: 11px; padding: 4px 10px;
border-radius: 7px; border: 1px solid var(--border);
background: var(--bg-card); color: var(--text-secondary);
cursor: pointer; transition: all 0.2s;
}
.pb-copy:hover { border-color: var(--accent); color: var(--accent); }
.prompt-box .pb-body {
font-size: 13px; line-height: 1.8; color: var(--text-primary);
white-space: pre-wrap; word-break: break-word;
}
.gen-meta { font-size: 11px; color: var(--text-muted); display: none; }
/* History */
.history-section { max-width: 1160px; margin: 0 auto; padding: 0 24px 40px; }
.history-head {
display: flex; justify-content: space-between; align-items: center;
margin-bottom: 14px;
}
.history-head h2 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.history-head .h-count { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.btn-clear {
font-size: 12px; padding: 6px 14px;
border-radius: 8px; border: 1px solid var(--border);
background: var(--bg-card); color: var(--text-secondary);
cursor: pointer; transition: all 0.2s;
}
.btn-clear:hover { border-color: var(--red); color: var(--red); }
.history-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
gap: 14px;
}
.history-empty {
border: 1px dashed var(--border);
border-radius: 14px;
padding: 28px;
text-align: center;
color: var(--text-muted);
font-size: 13px;
}
.h-card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 14px;
overflow: hidden;
cursor: pointer;
transition: all 0.2s;
position: relative;
}
.h-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.h-card .h-thumb {
width: 100%; height: 110px;
object-fit: cover; display: block;
background: var(--bg-secondary);
}
.h-card .h-info { padding: 10px 12px; }
.h-card .h-time { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.h-card .h-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.h-card .h-tag {
font-size: 10px; padding: 2px 8px;
border-radius: 10px;
background: rgba(74,144,217,0.08);
color: var(--accent);
font-weight: 600;
}
.h-card .h-del {
position: absolute; top: 8px; right: 8px;
width: 24px; height: 24px;
border-radius: 50%; border: none;
background: rgba(0,0,0,0.55); color: #fff;
font-size: 12px; cursor: pointer;
display: none; align-items: center; justify-content: center;
}
.h-card:hover .h-del { display: flex; }
.h-card .h-del:hover { background: var(--red); }
/* Tips */
.tips-section { max-width: 1160px; margin: 0 auto; padding: 0 24px 48px; }
.tips-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.tip-card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 14px;
padding: 20px;
}
.tip-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 7px; }
.tip-card p, .tip-card li { font-size: 13px; color: var(--text-secondary); line-height: 1.8; }
.tip-card ul { padding-left: 18px; }
.pro-strip {
margin-top: 16px;
background: linear-gradient(90deg, rgba(74,144,217,0.08), rgba(16,185,129,0.06));
border: 1px solid rgba(74,144,217,0.2);
border-radius: 14px;
padding: 16px 22px;
display: flex; align-items: center; justify-content: space-between; gap: 14px;
flex-wrap: wrap;
}
.pro-strip .ps-left { font-size: 13px; color: var(--text-secondary); }
.pro-strip .ps-left strong { color: var(--text-primary); }
.pro-badge {
display: inline-flex; align-items: center; gap: 4px;
font-size: 11px; font-weight: 700;
padding: 2px 9px; border-radius: 20px;
background: rgba(249,115,22,0.12);
color: var(--orange);
border: 1px solid rgba(249,115,22,0.3);
margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
/* Footer */
.footer { padding: 28px 0; border-top: 1px solid var(--border); }
.footer-content {
display: flex; justify-content: space-between; align-items: center;
flex-wrap: wrap; gap: 12px;
}
.footer-text { font-size: 13px; color: var(--text-muted); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 13px; color: var(--text-secondary); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
@media (max-width: 900px) {
.tool-body { grid-template-columns: 1fr; }
.tool-inputs { border-right: none; border-bottom: 1px solid var(--border); }
.fmt-chips { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 768px) {
.hero { padding: 110px 24px 28px; }
.hero h1 { font-size: 26px; }
.nav-links { display: none; }
.mobile-menu-btn {
display: flex;
flex-direction: column;
gap: 5px;
background: none;
border: none;
cursor: pointer;
padding: 8px;
z-index: 200;
}
.mobile-menu-btn span {
display: block;
width: 22px; height: 2px;
background: var(--text-primary);
border-radius: 2px;
transition: all 0.3s ease;
}
.mobile-menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
.nav-links.mobile-open {
display: flex !important;
position: fixed !important;
top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
width: 100vw !important; height: 100vh !important;
background: var(--navbar-bg) !important;
backdrop-filter: blur(20px) !important;
flex-direction: column !important;
align-items: center !important;
justify-content: center !important;
gap: 20px !important;
z-index: 9999 !important;
padding: 80px 24px 40px !important;
animation: fadeIn 0.2s ease;
visibility: visible !important;
opacity: 1 !important;
}
.nav-links.mobile-open li {
list-style: none !important;
width: 100% !important;
max-width: 280px !important;
display: block !important;
visibility: visible !important;
opacity: 1 !important;
}
.nav-links.mobile-open a,
.nav-links.mobile-open .nav-badge {
font-size: 17px !important;
color: var(--text-primary) !important;
text-decoration: none !important;
padding: 14px 24px !important;
display: block !important;
text-align: center !important;
border-radius: 12px !important;
transition: background 0.2s !important;
width: 100% !important;
visibility: visible !important;
opacity: 1 !important;
}
.nav-links.mobile-open a:hover,
.nav-links.mobile-open a:active { background: rgba(74, 144, 217, 0.12) !important; }
.nav-links.mobile-open .nav-badge {
font-size: 13px !important;
margin-top: 8px !important;
background: rgba(74,144,217,0.12) !important;
color: var(--accent) !important;
padding: 8px 16px !important;
border-radius: 20px !important;
text-align: center !important;
}
.footer-content { flex-direction: column; text-align: center; }
}
.nav-links a.active{background:var(--bg-hover);color:var(--accent);font-weight:600}
</style>
</head>
<body>
<script src="assets/notice.js"></script>
<nav class="navbar">
<div class="container">
<a href="index.html" class="logo">
<div class="logo-icon">A</div>
<div class="logo-text">API<span>排行榜</span></div>
</a>
<button class="mobile-menu-btn" onclick="toggleMobileMenu()" aria-label="菜单">
<span></span><span></span><span></span>
</button>
<ul class="nav-links" id="navLinks">
<li><a href="index.html#ranking">排行榜</a></li>
<li class="hide-m"><a href="tools.html" class="active">🔥 实用工具</a></li>
<li class="hide-m"><a href="javascript:void(0)" onclick="openFinderModal()">🎯 快速选站(适合你)</a></li>
<li><a href="index.html#guide">选站指南</a></li>
<li><a href="about.html">关于本站</a></li>
<li><a href="news.html">相关新闻</a></li>
<li class="hide-m"><span class="nav-badge">实时更新</span></li>
<li><button class="theme-toggle" onclick="toggleTheme()" id="themeToggle" title="切换深色/浅色模式">🌙</button></li>
<li><a href="https://github.com/Chenking-maker/api-rank" target="_blank" rel="noopener noreferrer" title="GitHub仓库" style="display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;flex-shrink:0;border-radius:8px;background:var(--bg-card);border:1px solid var(--border);transition:all 0.2s;" onmouseover="this.style.borderColor='var(--accent)'" onmouseout="this.style.borderColor='var(--border)'"><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" style="color:var(--text-primary);"><path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z"/></svg></a></li>
</ul>
</div>
</nav>
<!-- Hero -->
<section class="hero">
<a href="tools.html" class="hero-back">← 返回实用工具</a>
<div class="hero-badge">
<span>🖼️</span>
<span>图片反推提示词</span>
</div>
<h1>图片反推提示词</h1>
<p>上传任意图片,AI 从九大维度智能拆解画面要素,一键反推高质量绘图提示词。支持 GPT 生图 / Midjourney / Stable Diffusion / Flux 多种格式,结果可直接复制使用。</p>
</section>
<!-- Tool -->
<section class="tool-section">
<div class="tool-card">
<div class="tool-body">
<!-- 左侧:输入区 -->
<div class="tool-inputs">
<!-- 上传 -->
<div class="field">
<label class="flabel">上传图片</label>
<div class="dropzone" id="dropzone" onclick="document.getElementById('fileInput').click()">
<input type="file" id="fileInput" accept="image/jpeg,image/png,image/webp" style="display:none">
<div id="dzEmpty">
<div class="dz-icon">🖼️</div>
<div class="dz-main">拖拽 / 点击 / 粘贴上传</div>
<div class="dz-sub">支持 JPG / PNG / WebP,≤ 10MB</div>
</div>
<img id="dzPreview" class="preview" style="display:none" alt="预览图">
<button class="dz-remove" id="dzRemove" onclick="event.stopPropagation();clearImage()" title="移除图片">✕</button>
</div>
</div>
<!-- URL -->
<div class="field">
<label class="flabel">或输入图片链接</label>
<div class="url-row">
<input type="text" id="imageUrl" placeholder="https://example.com/image.jpg">
<button class="btn-mini" onclick="loadImageUrl()" title="载入图片">载入</button>
</div>
</div>
<!-- 模式 -->
<div class="field row-two">
<div>
<label class="flabel">分析模式</label>
<select id="detailMode">
<option value="detailed">详细版(含九维拆解)</option>
<option value="brief">简洁版(仅提示词)</option>
</select>
</div>
<div>
<label class="flabel">输出语言</label>
<select id="outLang">
<option value="zh">简体中文</option>
<option value="en">English</option>
</select>
</div>
</div>
<!-- 目标格式 -->
<div class="field">
<label class="flabel">目标格式</label>
<div class="fmt-chips" id="fmtChips">
<div class="fmt-chip active" data-fmt="gpt" title="自然语言段落,适配 GPT Image 2.5 / DALL-E 3">🤖<small>GPT生图</small></div>
<div class="fmt-chip" data-fmt="mj" title="关键词 + --ar 参数,适配 Midjourney V7">🌊<small>MJ</small></div>
<div class="fmt-chip" data-fmt="sd" title="标签 + 权重标记,适配 Stable Diffusion 4">🎨<small>SD</small></div>
<div class="fmt-chip" data-fmt="flux" title="自然语言短语,适配 Flux 2">⚡<small>Flux</small></div>
<div class="fmt-chip" data-fmt="generic" title="通用关键词,适配任意AI绘画工具">🔑<small>通用</small></div>
</div>
</div>
<!-- API 设置 -->
<div class="field">
<div class="api-box">
<div class="api-head">
<span>⚙️ API 配置</span>
<span class="hint">Key 仅存本地浏览器</span>
</div>
<div>
<label class="flabel">API Key</label>
<div class="key-row">
<input type="password" id="apiKey" placeholder="sk-...">
<button class="btn-mini" id="eyeBtn" onclick="toggleKeyVisible()" title="显示/隐藏">👁</button>
<button class="btn-mini" onclick="testConnection()" title="测试连接">🔗</button>
</div>
<label class="checkbox-label" style="margin-top:6px;">
<input type="checkbox" id="saveKey"> 记住 API Key(保存在本地)
</label>
<div class="key-status" id="keyStatus"></div>
</div>
<div>
<label class="flabel">Base URL</label>
<select id="baseUrlSelect" onchange="handleBaseUrlChange()">
<option value="">选择平台...</option>
<option value="https://api.savebill.store">省钱AI (savebill.store)</option>
<option value="https://api.teaai.cc">TeaAI (teaai.cc)</option>
<option value="https://api.zaotu.vip">造图局 (zaotu.vip)</option>
<option value="https://api.poloapi.com">PoloAPI (poloapi.com)</option>
<option value="https://api.dmxapi.com">大模型API (dmxapi.com)</option>
<option value="https://api.gptcat.cc">GPT猫 (gptcat.cc)</option>
<option value="custom">自定义 URL...</option>
</select>
<input type="text" id="customBaseUrl" placeholder="https://your-api.com(以 /v1 结尾请去掉)" style="display:none;margin-top:8px;">
<div style="font-size:11px;color:var(--text-muted);margin-top:5px;">选择你拥有 Key 的平台,不确定请查看该平台「API文档」页获取 Base URL。</div>
</div>
<div>
<label class="flabel">模型名称</label>
<input type="text" id="modelName" placeholder="例如 gpt-5-mini / gemini-3-flash(需支持视觉)">
</div>
</div>
</div>
<button class="gen-btn" id="genBtn" onclick="generate()">
<span>✨ 开始反推</span>
</button>
</div>
<!-- 右侧:输出区 -->
<div class="tool-output">
<div class="output-head">
<span>反推结果</span>
<div class="output-actions">
<button class="btn-act" id="btnCopyAll" onclick="copyAll()" disabled>📋 复制全部</button>
<button class="btn-act" id="btnExpTxt" onclick="exportTxt()" disabled>⬇️ TXT</button>
<button class="btn-act" id="btnExpMd" onclick="exportMd()" disabled>⬇️ MD</button>
</div>
</div>
<div class="empty-state" id="emptyState">
<div class="es-icon">🪄</div>
<div class="es-title">上传图片后点击「开始反推」</div>
<div class="es-sub">AI 将从主体、场景、风格、姿态、镜头、色彩、构图、光线、质感九个维度完整拆解你的图片,生成可直接使用的绘图提示词。</div>
</div>
<div class="stream-box" id="streamBox"></div>
<div class="prompt-boxes" id="promptBoxes">
<div class="prompt-box pos">
<div class="pb-head">
<span class="pb-title">✅ 正面提示词</span>
<button class="pb-copy" onclick="copyPos()">复制</button>
</div>
<div class="pb-body" id="posBody"></div>
</div>
<div class="prompt-box neg">
<div class="pb-head">
<span class="pb-title">🚫 负面提示词</span>
<button class="pb-copy" onclick="copyNeg()">复制</button>
</div>
<div class="pb-body" id="negBody"></div>
</div>
</div>
<div class="gen-meta" id="genMeta"></div>
</div>
</div>
</div>
</section>
<!-- History -->
<section class="history-section">
<div class="history-head">
<h2>🕘 历史记录 <span class="h-count" id="hCount"></span></h2>
<button class="btn-clear" id="btnClearHis" onclick="clearHistory()" style="display:none;">🗑 清空记录</button>
</div>
<div class="history-grid" id="historyGrid"></div>
</section>
<!-- Tips -->
<section class="tips-section">
<div class="tips-grid">
<div class="tip-card">
<h3>💡 使用技巧</h3>
<ul>
<li>分析需使用<b>支持视觉的模型</b>(如 GPT-5-mini、Gemini、Claude 系列),图像生成模型(GPT Image 2.5 等)无法识别图片。</li>
<li>GPT 生图格式输出自然语言段落,可直接粘贴到 GPT Image 2.5 / DALL-E 3 中使用,比例用文字描述。</li>
<li>Midjourney 格式自动附带 --ar 画幅参数,负面内容以 --no 形式给出,适配 Midjourney V7。</li>
<li>SD 格式自带 (keyword:1.2) 权重标记,适配 Stable Diffusion 4 / SDXL。</li>
<li>历史记录仅保存在你的浏览器本地(最多 20 条),可随时点击卡片恢复结果。</li>
</ul>
</div>
<div class="tip-card">
<h3>🔐 隐私与安全</h3>
<ul>
<li>API Key 与历史记录全部保存在本地浏览器,本站不存储、不上传。</li>
<li>请求由你的浏览器直接发往你所选的 API 平台,不经过第三方服务器。</li>
<li>建议使用额度有限的 Key,并定期在平台后台检查用量。</li>
</ul>
</div>
</div>
<div class="pro-strip">
<!-- 付费扩展预留:后续可在此接入会员/激活码校验逻辑 -->
<div class="ps-left">
<span class="pro-badge">PRO</span>
<strong>高级版规划中:</strong>批量图片反推 · 历史云同步 · 专属高速模型通道 · 无限次数。当前版本全部功能免费使用。
</div>
<a href="https://github.com/Chenking-maker/api-rank" target="_blank" rel="noopener noreferrer" class="btn-act" style="flex-shrink:0;">🔔 关注更新</a>
</div>
</section>
<footer class="footer">
<div class="container">
<div class="footer-content">
<div class="footer-text">© 2026 API排行榜 · 数据仅供参考,请自行判断</div>
<div class="footer-links">
<a href="index.html">首页</a>
<a href="index.html#ranking">排行榜</a>
<a href="tools.html">实用工具</a>
<a href="dead-sites.html">失效站点</a>
</div>
</div>
</div>
</footer>
<script>
// ================= 基础 UI =================
function toggleMobileMenu() {
const navLinks = document.getElementById('navLinks');
const menuBtn = document.querySelector('.mobile-menu-btn');
const isOpen = navLinks.classList.toggle('mobile-open');
menuBtn.classList.toggle('active');
document.body.style.overflow = isOpen ? 'hidden' : '';
}
function toggleTheme() {
const html = document.documentElement;
const next = html.getAttribute('data-theme') === 'dark' ? 'light' : 'dark';
html.setAttribute('data-theme', next);
localStorage.setItem('theme', next);
const btn = document.getElementById('themeToggle');
if (btn) btn.textContent = next === 'dark' ? '☀️' : '🌙';
}
(function() {
var t = document.documentElement.getAttribute('data-theme');
var btn = document.getElementById('themeToggle');
if (btn) btn.textContent = t === 'dark' ? '☀️' : '🌙';
})();
function closeMobileMenu() {
const navLinks = document.getElementById('navLinks');
const menuBtn = document.querySelector('.mobile-menu-btn');
if (navLinks && navLinks.classList.contains('mobile-open')) {
navLinks.classList.remove('mobile-open');
if (menuBtn) menuBtn.classList.remove('active');
document.body.style.overflow = '';
}
}
document.addEventListener('DOMContentLoaded', function() {
const navLinks = document.getElementById('navLinks');
if (navLinks) navLinks.querySelectorAll('a').forEach(function(link) {
link.addEventListener('click', closeMobileMenu);
});
document.addEventListener('keydown', function(e) { if (e.key === 'Escape') closeMobileMenu(); });
});
function openFinderModal() { alert('找适合自己的中转站功能正在开发中,请前往首页使用完整功能。'); }
function openSubmitModal() { alert('提交收录功能正在开发中,请前往首页使用完整功能。'); }
// ================= 状态 =================
const LS = {
key: 'pf_api_key', flag: 'pf_save_key', base: 'pf_base_url', custom: 'pf_base_custom',
model: 'pf_model', history: 'pf_history'
};
let currentImage = null; // { dataUrl } 或 { url }
let imageDataUrl = null; // 本地上传的 dataURL(用于缩略图)
let currentFormat = 'gpt';
let lastRaw = '';
let lastPos = '';
let lastNeg = '';
let abortCtrl = null;
let generating = false;
const FMT = {
gpt: {
name: 'GPT 生图格式',
rule: '正面提示词用流畅的自然语言段落完整描述画面,涵盖主体、场景、风格、动作、镜头、色彩、构图、光线与细节质感;图片比例用文字自然描述(例如"横版16:9宽幅画面"),禁止使用 --ar、--v 等参数标记;负面提示词用自然语言列出需要避免的元素。该格式用于直接粘贴到 GPT(GPT Image 2.5 / DALL-E 3 等 OpenAI 生图模型)中使用。'
},
mj: {
name: 'Midjourney 格式',
rule: '正面提示词用逗号分隔的关键词或短语,按重要性从高到低排列,并在末尾自动附加画幅参数 --ar {RATIO};负面提示词以 --no 参数形式列出。适配 Midjourney V7。'
},
sd: {
name: 'Stable Diffusion 格式',
rule: '正面提示词用逗号分隔的标签式关键词,重要关键词使用权重标记,如 (keyword:1.2);负面提示词使用 SD 标签格式列出需避免的元素。适配 Stable Diffusion 4 / SDXL 系列。'
},
flux: {
name: 'Flux 格式',
rule: '正面提示词用自然语言的简洁短语组合,流畅连贯,不使用权重符号与参数标记;负面提示词用简洁短语列出。适配 Flux 2 系列。'
},
generic: {
name: '通用关键词格式',
rule: '正面提示词用逗号分隔的关键词,按重要性排序,通用适配各类 AI 绘画工具;负面提示词列出需要避免的元素。'
}
};