hmb HF Staff commited on
Commit
24c3178
·
verified ·
1 Parent(s): 2275dd5

Upload folder using huggingface_hub

Browse files
Files changed (4) hide show
  1. README.md +4 -5
  2. app.py +2 -3
  3. build_graph.py +2 -5
  4. workflow.json +0 -166
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- title: FLUX 3 Klein vs FLUX.2 Klein 4B & 9B
3
  emoji: 🌲
4
  colorFrom: green
5
  colorTo: gray
@@ -10,14 +10,13 @@ pinned: false
10
  hf_oauth: true
11
  hf_oauth_scopes:
12
  - inference-api
13
- short_description: gr.Workflow comparing FLUX 3 Klein vs FLUX.2 Klein 4B/9B
14
  ---
15
 
16
  One prompt + seed + size fan out on a gr.Workflow canvas to
17
  [FLUX 3 Image Klein](https://huggingface.co/spaces/black-forest-labs/flux-3-image-klein)
18
- and its predecessors [FLUX.2 Klein 4B](https://huggingface.co/spaces/black-forest-labs/FLUX.2-klein-4B) and
19
- [FLUX.2 Klein 9B](https://huggingface.co/spaces/black-forest-labs/FLUX.2-klein-9B),
20
- then shows all three images side by side. All three share prompt, seed, size, mode (default Base 50 steps), steps (50), guidance (3.5) and
21
  prompt upsampling (off).
22
 
23
  Calls go to the official BFL Spaces (ZeroGPU) as native Space nodes (no custom code), using your HF login
 
1
  ---
2
+ title: FLUX 3 Klein vs FLUX.2 Klein
3
  emoji: 🌲
4
  colorFrom: green
5
  colorTo: gray
 
10
  hf_oauth: true
11
  hf_oauth_scopes:
12
  - inference-api
13
+ short_description: gr.Workflow comparing FLUX 3 Klein and FLUX.2 Klein 4B
14
  ---
15
 
16
  One prompt + seed + size fan out on a gr.Workflow canvas to
17
  [FLUX 3 Image Klein](https://huggingface.co/spaces/black-forest-labs/flux-3-image-klein)
18
+ and its predecessor [FLUX.2 Klein 4B](https://huggingface.co/spaces/black-forest-labs/FLUX.2-klein-4B),
19
+ then shows both images side by side. Both share prompt, seed, size, mode (default Base 50 steps), steps (50), guidance (3.5) and
 
20
  prompt upsampling (off).
21
 
22
  Calls go to the official BFL Spaces (ZeroGPU) as native Space nodes (no custom code), using your HF login
app.py CHANGED
@@ -1,8 +1,7 @@
1
- """FLUX 3 Image Klein vs FLUX.2 Klein 4B & 9B: a gr.Workflow with no custom Python nodes.
2
 
3
  Prompt / Seed / Width / Height ─┬─> Space node: black-forest-labs/flux-3-image-klein (/generate) ─> image
4
- ├─> Space node: black-forest-labs/FLUX.2-klein-4B (/infer) ─> image
5
- └─> Space node: black-forest-labs/FLUX.2-klein-9B (/generate) ─> image
6
  Shared refs: Prompt, Seed, Width, Height, Mode (Base (50 steps)), Steps (50), Guidance (3.5), Prompt upsampling (off). Graph lives in
7
  workflow.json (generated by build_graph.py). Space calls use the visitor's HF login
8
  (OAuth) so ZeroGPU quota is theirs; nothing is hardcoded."""
 
1
+ """FLUX 3 Image Klein vs FLUX.2 Klein 4B: a gr.Workflow with no custom Python nodes.
2
 
3
  Prompt / Seed / Width / Height ─┬─> Space node: black-forest-labs/flux-3-image-klein (/generate) ─> image
4
+ └─> Space node: black-forest-labs/FLUX.2-klein-4B (/infer) ─> image
 
5
  Shared refs: Prompt, Seed, Width, Height, Mode (Base (50 steps)), Steps (50), Guidance (3.5), Prompt upsampling (off). Graph lives in
6
  workflow.json (generated by build_graph.py). Space calls use the visitor's HF login
7
  (OAuth) so ZeroGPU quota is theirs; nothing is hardcoded."""
build_graph.py CHANGED
@@ -14,14 +14,11 @@ ops=[{"id":"klein3","role":"operator","kind":"space","space_id":"black-forest-la
14
  "data":{**common}},
15
  {"id":"klein2","role":"operator","kind":"space","space_id":"black-forest-labs/FLUX.2-klein-4B","endpoint":"/infer",
16
  "label":"FLUX.2 Klein 4B (previous)","inputs":ins(),"outputs":[T("image","Image","image",output_index=0)],
17
- "data":{**common}},
18
- {"id":"klein9","role":"operator","kind":"space","space_id":"black-forest-labs/FLUX.2-klein-9B","endpoint":"/generate",
19
- "label":"FLUX.2 Klein 9B (previous, larger)","inputs":ins(),"outputs":[T("image","Image","image",output_index=0)],
20
  "data":{**common}}]
21
  def subj(i,l): return {"id":i,"role":"subject","label":l,"asset_type":"image","inputs":[T("in",l,"image")],"outputs":[T("out",l,"image")],"data":{}}
22
- subs=[subj("out_klein3","FLUX 3 Image Klein"),subj("out_klein2","FLUX.2 Klein 4B (previous)"),subj("out_klein9","FLUX.2 Klein 9B (previous, larger)")]
23
  E=[]
24
- for op in ["klein3","klein2","klein9"]:
25
  for r,t in [("prompt","text"),("seed","number"),("width","number"),("height","number"),("mode_choice","text"),("num_inference_steps","number"),("guidance_scale","number"),("prompt_upsampling","boolean")]:
26
  E.append((r,"out",op,r,t))
27
  E.append((op,"image","out_"+op,"in","image"))
 
14
  "data":{**common}},
15
  {"id":"klein2","role":"operator","kind":"space","space_id":"black-forest-labs/FLUX.2-klein-4B","endpoint":"/infer",
16
  "label":"FLUX.2 Klein 4B (previous)","inputs":ins(),"outputs":[T("image","Image","image",output_index=0)],
 
 
 
17
  "data":{**common}}]
18
  def subj(i,l): return {"id":i,"role":"subject","label":l,"asset_type":"image","inputs":[T("in",l,"image")],"outputs":[T("out",l,"image")],"data":{}}
19
+ subs=[subj("out_klein3","FLUX 3 Image Klein"),subj("out_klein2","FLUX.2 Klein 4B (previous)")]
20
  E=[]
21
+ for op in ["klein3","klein2"]:
22
  for r,t in [("prompt","text"),("seed","number"),("width","number"),("height","number"),("mode_choice","text"),("num_inference_steps","number"),("guidance_scale","number"),("prompt_upsampling","boolean")]:
23
  E.append((r,"out",op,r,t))
24
  E.append((op,"image","out_"+op,"in","image"))
workflow.json CHANGED
@@ -333,79 +333,6 @@
333
  "input_images": [],
334
  "randomize_seed": false
335
  }
336
- },
337
- {
338
- "id": "klein9",
339
- "role": "operator",
340
- "kind": "space",
341
- "space_id": "black-forest-labs/FLUX.2-klein-9B",
342
- "endpoint": "/generate",
343
- "label": "FLUX.2 Klein 9B (previous, larger)",
344
- "inputs": [
345
- {
346
- "id": "prompt",
347
- "label": "Prompt",
348
- "type": "text",
349
- "required": true
350
- },
351
- {
352
- "id": "input_images",
353
- "label": "Input images",
354
- "type": "json"
355
- },
356
- {
357
- "id": "mode_choice",
358
- "label": "Mode",
359
- "type": "text"
360
- },
361
- {
362
- "id": "seed",
363
- "label": "Seed",
364
- "type": "number"
365
- },
366
- {
367
- "id": "randomize_seed",
368
- "label": "Randomize seed",
369
- "type": "boolean"
370
- },
371
- {
372
- "id": "width",
373
- "label": "Width",
374
- "type": "number"
375
- },
376
- {
377
- "id": "height",
378
- "label": "Height",
379
- "type": "number"
380
- },
381
- {
382
- "id": "num_inference_steps",
383
- "label": "Steps",
384
- "type": "number"
385
- },
386
- {
387
- "id": "guidance_scale",
388
- "label": "Guidance",
389
- "type": "number"
390
- },
391
- {
392
- "id": "prompt_upsampling",
393
- "label": "Prompt upsampling",
394
- "type": "boolean"
395
- }
396
- ],
397
- "outputs": [
398
- {
399
- "id": "image",
400
- "label": "Image",
401
- "type": "image",
402
- "output_index": 0
403
- }
404
- ],
405
- "data": {
406
- "input_images": [],
407
- "randomize_seed": false
408
- }
409
  }
410
  ],
411
  "subjects": [
@@ -450,27 +377,6 @@
450
  }
451
  ],
452
  "data": {}
453
- },
454
- {
455
- "id": "out_klein9",
456
- "role": "subject",
457
- "label": "FLUX.2 Klein 9B (previous, larger)",
458
- "asset_type": "image",
459
- "inputs": [
460
- {
461
- "id": "in",
462
- "label": "FLUX.2 Klein 9B (previous, larger)",
463
- "type": "image"
464
- }
465
- ],
466
- "outputs": [
467
- {
468
- "id": "out",
469
- "label": "FLUX.2 Klein 9B (previous, larger)",
470
- "type": "image"
471
- }
472
- ],
473
- "data": {}
474
  }
475
  ],
476
  "edges": [
@@ -617,78 +523,6 @@
617
  "to_node_id": "out_klein2",
618
  "to_port_id": "in",
619
  "type": "image"
620
- },
621
- {
622
- "id": "e18",
623
- "from_node_id": "prompt",
624
- "from_port_id": "out",
625
- "to_node_id": "klein9",
626
- "to_port_id": "prompt",
627
- "type": "text"
628
- },
629
- {
630
- "id": "e19",
631
- "from_node_id": "seed",
632
- "from_port_id": "out",
633
- "to_node_id": "klein9",
634
- "to_port_id": "seed",
635
- "type": "number"
636
- },
637
- {
638
- "id": "e20",
639
- "from_node_id": "width",
640
- "from_port_id": "out",
641
- "to_node_id": "klein9",
642
- "to_port_id": "width",
643
- "type": "number"
644
- },
645
- {
646
- "id": "e21",
647
- "from_node_id": "height",
648
- "from_port_id": "out",
649
- "to_node_id": "klein9",
650
- "to_port_id": "height",
651
- "type": "number"
652
- },
653
- {
654
- "id": "e22",
655
- "from_node_id": "mode_choice",
656
- "from_port_id": "out",
657
- "to_node_id": "klein9",
658
- "to_port_id": "mode_choice",
659
- "type": "text"
660
- },
661
- {
662
- "id": "e23",
663
- "from_node_id": "num_inference_steps",
664
- "from_port_id": "out",
665
- "to_node_id": "klein9",
666
- "to_port_id": "num_inference_steps",
667
- "type": "number"
668
- },
669
- {
670
- "id": "e24",
671
- "from_node_id": "guidance_scale",
672
- "from_port_id": "out",
673
- "to_node_id": "klein9",
674
- "to_port_id": "guidance_scale",
675
- "type": "number"
676
- },
677
- {
678
- "id": "e25",
679
- "from_node_id": "prompt_upsampling",
680
- "from_port_id": "out",
681
- "to_node_id": "klein9",
682
- "to_port_id": "prompt_upsampling",
683
- "type": "boolean"
684
- },
685
- {
686
- "id": "e26",
687
- "from_node_id": "klein9",
688
- "from_port_id": "image",
689
- "to_node_id": "out_klein9",
690
- "to_port_id": "in",
691
- "type": "image"
692
  }
693
  ]
694
  }
 
333
  "input_images": [],
334
  "randomize_seed": false
335
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
336
  }
337
  ],
338
  "subjects": [
 
377
  }
378
  ],
379
  "data": {}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
380
  }
381
  ],
382
  "edges": [
 
523
  "to_node_id": "out_klein2",
524
  "to_port_id": "in",
525
  "type": "image"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
526
  }
527
  ]
528
  }