diff --git a/static/js/components/LoraCard.js b/static/js/components/LoraCard.js index 7c1427fb..87a536bb 100644 --- a/static/js/components/LoraCard.js +++ b/static/js/components/LoraCard.js @@ -39,7 +39,7 @@ export function createLoraCard(lora) { ${!lora.from_civitai ? 'style="opacity: 0.5; cursor: not-allowed"' : ''}> + title="Copy LoRA Syntax"> @@ -80,8 +80,12 @@ export function createLoraCard(lora) { // Copy button click event card.querySelector('.fa-copy')?.addEventListener('click', e => { e.stopPropagation(); - navigator.clipboard.writeText(card.dataset.file_name) - .then(() => showToast('Model name copied', 'success')) + const usageTips = JSON.parse(card.dataset.usage_tips || '{}'); + const strength = usageTips.strength || 1; + const loraSyntax = ``; + + navigator.clipboard.writeText(loraSyntax) + .then(() => showToast('LoRA syntax copied', 'success')) .catch(() => showToast('Copy failed', 'error')); }); diff --git a/templates/components/context_menu.html b/templates/components/context_menu.html index 4900171a..aa6cb21d 100644 --- a/templates/components/context_menu.html +++ b/templates/components/context_menu.html @@ -9,7 +9,7 @@ Refresh Civitai Data
- Copy Model Name + Copy LoRA Syntax
diff --git a/workflow/lora_manager_flux_example.json b/workflow/lora_manager_flux_example.json new file mode 100644 index 00000000..26975f87 --- /dev/null +++ b/workflow/lora_manager_flux_example.json @@ -0,0 +1,846 @@ +{ + "last_node_id": 47, + "last_link_id": 77, + "nodes": [ + { + "id": 34, + "type": "Note", + "pos": [ + 831, + 501 + ], + "size": [ + 282.8617858886719, + 164.08004760742188 + ], + "flags": {}, + "order": 0, + "mode": 0, + "inputs": [], + "outputs": [], + "properties": { + "text": "" + }, + "widgets_values": [ + "Note that Flux dev and schnell do not have any negative prompt so CFG should be set to 1.0. Setting CFG to 1.0 means the negative prompt is ignored." + ], + "color": "#432", + "bgcolor": "#653" + }, + { + "id": 33, + "type": "CLIPTextEncode", + "pos": [ + 515.009033203125, + 393.20904541015625 + ], + "size": [ + 422.84503173828125, + 164.31304931640625 + ], + "flags": { + "collapsed": true + }, + "order": 7, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 63, + "slot_index": 0 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 55 + ], + "slot_index": 0 + } + ], + "title": "CLIP Text Encode (Negative Prompt)", + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "" + ], + "color": "#322", + "bgcolor": "#533" + }, + { + "id": 46, + "type": "JoinStrings", + "pos": [ + 696.0320434570312, + -173.09176635742188 + ], + "size": [ + 315, + 106 + ], + "flags": { + "collapsed": true + }, + "order": 9, + "mode": 0, + "inputs": [ + { + "name": "string1", + "type": "STRING", + "link": 73, + "widget": { + "name": "string1" + } + }, + { + "name": "string2", + "type": "STRING", + "link": 74, + "widget": { + "name": "string2" + } + } + ], + "outputs": [ + { + "name": "STRING", + "type": "STRING", + "links": [ + 76 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "JoinStrings" + }, + "widgets_values": [ + "", + "", + "," + ] + }, + { + "id": 41, + "type": "easy showAnything", + "pos": [ + 853.4336547851562, + -430.6646728515625 + ], + "size": [ + 343, + 186 + ], + "flags": {}, + "order": 8, + "mode": 0, + "inputs": [ + { + "name": "anything", + "type": "*", + "link": 65, + "shape": 7 + } + ], + "outputs": [ + { + "name": "output", + "type": "*", + "links": null + } + ], + "title": "loaded loras", + "properties": { + "Node name for S&R": "easy showAnything" + }, + "widgets_values": [ + "pp-storybook_rank2_bf16: 1.0\npsycho_art: 1.3" + ], + "color": "#233", + "bgcolor": "#355" + }, + { + "id": 31, + "type": "KSampler", + "pos": [ + 816, + 192 + ], + "size": [ + 315, + 262 + ], + "flags": {}, + "order": 13, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 61 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 57 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 55 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 51 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 52 + ], + "slot_index": 0, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 42, + "fixed", + 20, + 1, + "euler", + "simple", + 1 + ] + }, + { + "id": 27, + "type": "EmptySD3LatentImage", + "pos": [ + 471, + 455 + ], + "size": [ + 315, + 106 + ], + "flags": {}, + "order": 1, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 51 + ], + "slot_index": 0, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "EmptySD3LatentImage" + }, + "widgets_values": [ + 768, + 768, + 1 + ], + "color": "#323", + "bgcolor": "#535" + }, + { + "id": 8, + "type": "VAEDecode", + "pos": [ + 1151, + 195 + ], + "size": [ + 210, + 46 + ], + "flags": {}, + "order": 14, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 52 + }, + { + "name": "vae", + "type": "VAE", + "link": 64 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 77 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "VAEDecode" + }, + "widgets_values": [] + }, + { + "id": 39, + "type": "VAELoader", + "pos": [ + -140, + 320 + ], + "size": [ + 210, + 58 + ], + "flags": { + "collapsed": false + }, + "order": 2, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "VAE", + "type": "VAE", + "links": [ + 64 + ], + "slot_index": 0, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "VAELoader", + "enableTabs": false, + "tabWidth": 65, + "tabXOffset": 10, + "hasSecondTab": false, + "secondTabText": "Send Back", + "secondTabOffset": 80, + "secondTabWidth": 65 + }, + "widgets_values": [ + "flux1\\ae.safetensors" + ] + }, + { + "id": 37, + "type": "UNETLoader", + "pos": [ + -230, + -30 + ], + "size": [ + 315, + 82 + ], + "flags": {}, + "order": 3, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 59 + ], + "slot_index": 0 + } + ], + "properties": { + "Node name for S&R": "UNETLoader", + "enableTabs": false, + "tabWidth": 65, + "tabXOffset": 10, + "hasSecondTab": false, + "secondTabText": "Send Back", + "secondTabOffset": 80, + "secondTabWidth": 65 + }, + "widgets_values": [ + "flux\\flux1-dev-fp8-e4m3fn.safetensors", + "fp8_e4m3fn" + ] + }, + { + "id": 38, + "type": "DualCLIPLoader", + "pos": [ + -220, + 110 + ], + "size": [ + 313.5278625488281, + 106 + ], + "flags": {}, + "order": 4, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 60 + ], + "slot_index": 0, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "DualCLIPLoader", + "enableTabs": false, + "tabWidth": 65, + "tabXOffset": 10, + "hasSecondTab": false, + "secondTabText": "Send Back", + "secondTabOffset": 80, + "secondTabWidth": 65 + }, + "widgets_values": [ + "t5xxl_fp8_e4m3fn.safetensors", + "clip_l.safetensors", + "flux", + "default" + ] + }, + { + "id": 47, + "type": "PreviewImage", + "pos": [ + 1377.63232421875, + 189.60824584960938 + ], + "size": [ + 441, + 365.8999938964844 + ], + "flags": {}, + "order": 15, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 77 + } + ], + "outputs": [], + "properties": { + "Node name for S&R": "PreviewImage" + }, + "widgets_values": [] + }, + { + "id": 6, + "type": "CLIPTextEncode", + "pos": [ + 516.9750366210938, + 335.9007568359375 + ], + "size": [ + 422.84503173828125, + 164.31304931640625 + ], + "flags": { + "collapsed": true + }, + "order": 11, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 62 + }, + { + "name": "text", + "type": "STRING", + "link": 72, + "widget": { + "name": "text" + } + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 56 + ], + "slot_index": 0 + } + ], + "title": "CLIP Text Encode (Positive Prompt)", + "properties": { + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "cute anime girl with massive fluffy fennec ears and a big fluffy tail blonde messy long hair blue eyes wearing a maid outfit with a long black gold leaf pattern dress and a white apron mouth open placing a fancy black forest cake with candles on top of a dinner table of an old dark Victorian mansion lit by candlelight with a bright window to the foggy forest and very expensive stuff everywhere there are paintings on the walls" + ], + "color": "#232", + "bgcolor": "#353" + }, + { + "id": 35, + "type": "FluxGuidance", + "pos": [ + 583.529541015625, + 221.86776733398438 + ], + "size": [ + 211.60000610351562, + 58 + ], + "flags": {}, + "order": 12, + "mode": 0, + "inputs": [ + { + "name": "conditioning", + "type": "CONDITIONING", + "link": 56 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 57 + ], + "slot_index": 0, + "shape": 3 + } + ], + "properties": { + "Node name for S&R": "FluxGuidance" + }, + "widgets_values": [ + 3.5 + ] + }, + { + "id": 42, + "type": "easy showAnything", + "pos": [ + 858.0067749023438, + -195.9464569091797 + ], + "size": [ + 344.583740234375, + 150.5681915283203 + ], + "flags": {}, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "anything", + "type": "*", + "link": 76, + "shape": 7 + } + ], + "outputs": [ + { + "name": "output", + "type": "*", + "links": [ + 72 + ], + "slot_index": 0 + } + ], + "title": "trigger words & prompt", + "properties": { + "Node name for S&R": "easy showAnything" + }, + "widgets_values": [ + "ppstorybook, pscho_4rt, surreal, abstract, glitch,cute anime girl with massive fluffy fennec ears and a big fluffy tail blonde messy long hair blue eyes wearing a maid outfit with a long black gold leaf pattern dress and a white apron mouth open placing a fancy black forest cake with candles on top of a dinner table of an old dark Victorian mansion lit by candlelight with a bright window to the foggy forest and very expensive stuff everywhere there are paintings on the walls" + ], + "color": "#232", + "bgcolor": "#353" + }, + { + "id": 40, + "type": "LoRALoader", + "pos": [ + 180.88629150390625, + -261.74188232421875 + ], + "size": [ + 400, + 200 + ], + "flags": {}, + "order": 6, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 59 + }, + { + "name": "clip", + "type": "CLIP", + "link": 60 + } + ], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 61 + ], + "slot_index": 0 + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 62, + 63 + ], + "slot_index": 1 + }, + { + "name": "loaded_loras", + "type": "STRING", + "links": [ + 65 + ], + "slot_index": 2 + }, + { + "name": "trigger_words", + "type": "STRING", + "links": [ + 73 + ], + "slot_index": 3 + } + ], + "properties": { + "Node name for S&R": "LoRALoader" + }, + "widgets_values": [ + "" + ], + "color": "#432", + "bgcolor": "#653" + }, + { + "id": 45, + "type": "easy string", + "pos": [ + 192.89907836914062, + -7.67711877822876 + ], + "size": [ + 391.3636474609375, + 83.45454406738281 + ], + "flags": {}, + "order": 5, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "string", + "type": "STRING", + "links": [ + 74 + ], + "slot_index": 0 + } + ], + "title": "prompt", + "properties": { + "Node name for S&R": "easy string" + }, + "widgets_values": [ + "cute anime girl with massive fluffy fennec ears and a big fluffy tail blonde messy long hair blue eyes wearing a maid outfit with a long black gold leaf pattern dress and a white apron mouth open placing a fancy black forest cake with candles on top of a dinner table of an old dark Victorian mansion lit by candlelight with a bright window to the foggy forest and very expensive stuff everywhere there are paintings on the walls" + ], + "color": "#232", + "bgcolor": "#353" + } + ], + "links": [ + [ + 51, + 27, + 0, + 31, + 3, + "LATENT" + ], + [ + 52, + 31, + 0, + 8, + 0, + "LATENT" + ], + [ + 55, + 33, + 0, + 31, + 2, + "CONDITIONING" + ], + [ + 56, + 6, + 0, + 35, + 0, + "CONDITIONING" + ], + [ + 57, + 35, + 0, + 31, + 1, + "CONDITIONING" + ], + [ + 59, + 37, + 0, + 40, + 0, + "MODEL" + ], + [ + 60, + 38, + 0, + 40, + 1, + "CLIP" + ], + [ + 61, + 40, + 0, + 31, + 0, + "MODEL" + ], + [ + 62, + 40, + 1, + 6, + 0, + "CLIP" + ], + [ + 63, + 40, + 1, + 33, + 0, + "CLIP" + ], + [ + 64, + 39, + 0, + 8, + 1, + "VAE" + ], + [ + 65, + 40, + 2, + 41, + 0, + "*" + ], + [ + 72, + 42, + 0, + 6, + 1, + "STRING" + ], + [ + 73, + 40, + 3, + 46, + 0, + "STRING" + ], + [ + 74, + 45, + 0, + 46, + 1, + "STRING" + ], + [ + 76, + 46, + 0, + 42, + 0, + "*" + ], + [ + 77, + 8, + 0, + 47, + 0, + "IMAGE" + ] + ], + "groups": [], + "config": {}, + "extra": { + "node_versions": { + "comfy-core": "0.3.14", + "ComfyUI-KJNodes": "9a3434ffa335a16949aa4c3196a2cd37ba7b4876", + "ComfyUI-Easy-Use": "0b64d4c29733f79bcc491e286df333a943e17152", + "ComfyUI-Lora-Manager": "3fa8bae2056976f3df828064de3542dd5a360d60" + }, + "ue_links": [], + "VHS_latentpreview": false, + "VHS_latentpreviewrate": 0 + }, + "version": 0.4 +} \ No newline at end of file