description: <p><strong>Workflow</strong></p><p>Dataset creation:</p><ol><li><p>I've used gallery-dl (<a target="_blank" rel="ugc" href="https://github.com/mikf/gallery-dl">GitHub</a>) to scrape images of of different websites</p></li><li><p>I've removed duplicates with czkawka (<a target="_blank" rel="ugc" href="https://github.com/qarmin/czkawka">GitHub</a>)</p></li><li><p>I've chose my favorite images and captioned them using ChatGPT (gpt4-o)</p></li><li><p>I've captioned the rest with joycaption using this taggui fork (<a rel="ugc" href="https://github.com/doloreshaze337/taggui">GitHub</a>)</p></li><li><p>I've used [Code 1] to make sure the captions were made correctly using an llm with ollama</p></li><li><p>I've trained the model for 6000 steps using [config 1] with ostris/ai-toolkit (<a rel="ugc" href="https://github.com/ostris/ai-toolkit">GitHub</a>)</p></li></ol><p></p><p>Code 1:</p><pre><code>import ollama
  import os
  
  directory = [dataset-path]
  instruction = """You will receive a caption text that describes pictures featuring a the game character from Bloodborne called the "Hunter". Your task is to seamlessly incorporate the characters name into the caption with minimal changes when the characters name is not mentioned. The goal is to subtly include the characters name without explicitly stating that the character is called the "Hunter" if this is not the case already. If the characters name is already mentioned in the caption just return the caption as it was. Do not return something else besides the caption"""
  modelname = "Tiger-Gemma-9B:latest"
  output_directory = [output-path]
  
  def pairCaptions(txtfiles, first_directory, instruction, modelname, output_directory, second_directory):
      progress = 0
      for txtfile in txtfiles:
          with open(os.path.join(first_directory, txtfile), "r") as content: caption = content.read()
          with open(os.path.join(second_directory, txtfile), "r") as content2: caption2 = content2.read()
          modifiedcaptions = ollama.generate(model=modelname, prompt=f"{instruction}{caption}. And here is the descriptory list: {caption2}")
          open(os.path.join(output_directory, txtfile), "w").write(modifiedcaptions["response"])
          progress += 1
          print(f"Modified {txtfile} ({progress}/{len(txtfiles)})")
          print(modifiedcaptions["response"])
  
  def CaptionsEdit(txtfiles, directory, instruction, modelname, output_directory):
      progress = 0
      for txtfile in txtfiles:
          with open(os.path.join(directory, txtfile), "r") as content: caption = content.read()
          modifiedcaptions = ollama.generate(model=modelname, prompt=f"{instruction}This is the caption text: {caption}")
          open(os.path.join(output_directory, txtfile), "w").write(modifiedcaptions["response"])
          progress += 1
          print(f"Modified {txtfile} ({progress}/{len(txtfiles)})")
          print(modifiedcaptions["response"])
  
  txtfiles = [f for f in os.listdir(directory) if f.endswith(".txt")]
  CaptionsEdit(txtfiles, directory, instruction, modelname, output_directory)</code></pre><p></p><p>Config 1:</p><pre><code>job: extension
  config:
    name: f1_char_hunter_v2
    process:
    - type: sd_trainer
      training_folder: output
      device: cuda:0
      network:
        type: lora
        linear: 16
        linear_alpha: 16
      save:
        dtype: float16
        save_every: 319
        max_step_saves_to_keep: 4
        push_to_hub: false
      datasets:
      - folder_path: [path]
          (bloodborne)\hunterbb_v2
        caption_ext: txt
        caption_dropout_rate: 0.05
        shuffle_tokens: false
        cache_latents_to_disk: true
        resolution:
        - 512
        - 768
        - 1024
      train:
        batch_size: 1
        steps: 6000
        gradient_accumulation_steps: 1
        train_unet: true
        train_text_encoder: false
        gradient_checkpointing: true
        noise_scheduler: flowmatch
        optimizer: adamw8bit
        lr: 0.0001
        ema_config:
          use_ema: true
          ema_decay: 0.99
        dtype: bf16
      model:
        name_or_path: black-forest-labs/FLUX.1-dev
        is_flux: true
        quantize: true
      sample:
        sampler: flowmatch
        sample_every: 319
        width: 1024
        height: 1024
        prompts:
        - The image is a digital drawing rendered in a dark moody style with a muted
          color palette dominated by shades of brown and grey. The character stands
          in a commanding pose clad in a long dark coat with intricate ornate details
          reminiscent of a historical military uniform. The coat is adorned with silver
          buttons and a high collar and a large dark hat with a feathered plume sits
          atop the character's head casting a shadow over their face. The hunter's facehunter
        - Hunter stands in a powerful, poised stance, dressed in dark, worn armor with
          detailed engravings on the bracers and boots. The character's face is obscured
          by a high-collared scarf and a battle-worn helmet with broken edges. Hunter
          wields a large, serrated blade in one hand and a finely crafted pistol in
          the other. The muted, smoky background enhances the grim and determined aura
          of the figure.
        - Hunter is depicted in a dynamic pixel art style, standing in an aggressive,
          battle-ready stance. The character's flowing cape and dark attire are accentuated
          with bold shading and highlights, giving depth to the design. Hunter holds
          a large, serrated weapon in one hand and a gun in the other, both drawn in
          intricate pixel detail. The overall composition, framed by a thin border,
          captures a sense of action and intensity.
        - Hunter stands in a mystical and foreboding scene, surrounded by colossal,
          shadowy statues of beasts emerging from swirling orange and blue mists. The
          character is dwarfed by these monumental figures, yet their posture remains
          calm and composed, holding a weapon at their side. A large, glowing moon looms
          behind a domed structure, casting an ethereal light over the surreal landscape,
          creating a vivid contrast between light and shadow, heightening the atmosphere
          of mystery and tension.
        - Hunter is captured in a moment of intense agony or transformation, with their
          head thrown back and hands clawing upward. The character's form is engulfed
          in darkness, contrasting sharply with the vivid, fiery red background that
          swirls around them. Their eyes glow with a fierce, almost demonic light, and
          the scene exudes a powerful sense of torment and rage. The dramatic use of
          color and the dynamic pose create a haunting, visceral image of Hunter in
          the throes of a violent and overwhelming force.
        - The image is a digital drawing in a dark gothic style featuring a male character
          with a stern imposing presence. The character is dressed in a long dark coat
          with intricate stitching and a high collar adorned with a large dark hat that
          covers most of his face giving him a mysterious intimidating appearance. His
          eyes are hidden behind the hat adding to the enigmatic aura. The coat is detailed
          with gold accents on the shoulders and cuffs and a large belt buckle.hunter
        - The image is a digital drawing in an anime style depicting a young woman with
          a pale complexion and long lavender hair styled in a braid with a blue ribbon.
          She wears a black wide-brimmed hat with a dark almost black coat and gloves
          giving her a mysterious and ominous appearance. Her eyes are large and expressive
          with a hint of sadness or determination. The background is a fiery scene with
          dark swirling smoke and flames suggesting a battle or a post-aphunter
        - Hunter is illustrated in a stylized, semi-realistic portrait, with a focused
          side profile. The character has striking white hair partially concealed by
          a dark, tattered hat, while their lower face is obscured by a black scarf.
          Hunter's piercing blue eyes stand out against the muted tones of their green
          cloak and dark attire. The clean, minimal background enhances the character's
          sharp, detailed features, conveying a sense of calm determination and mystery.
        neg: ''
        seed: 99
        walk_seed: true
        guidance_scale: 4
        sample_steps: 20
  meta:
    name: f1_char_hunter_v2
    version: '2.0'</code></pre>
modelVersions.availability: Public
modelVersions.baseModel: Flux.1 D
modelVersions.downloadUrl: https://civitai.com/api/download/models/820444
modelVersions.downloaded: true
modelVersions.downloadUrl: https://civitai.com/api/download/models/820444
modelVersions.AutoV1: FC87924D
modelVersions.AutoV2: 9154C6AEB4
modelVersions.AutoV3: 45D06CCAAB32
modelVersions.BLAKE3: 0924C0BAF093E3DE193C514DADA15FD310AED6F268CA2B30FCEE49AA903538F3
modelVersions.CRC32: 739DC5F6
modelVersions.SHA256: 9154C6AEB483F584E45DB03F609FA163DF12632079404BCBA721F26D277A8BEF
modelVersions.format: SafeTensor
modelVersions.name: f1_char_hunter_v2.safetensors
modelVersions.pickleScanMessage: No Pickle imports
modelVersions.pickleScanResult: Success
modelVersions.scannedAt: 2024-09-08T16:47:27.904Z
modelVersions.type: Model
modelVersions.virusScanResult: Success
modelVersions.hash: U02$56Io00?HRjayI:oL00xu~WE1S$WBxGfl
modelVersions.type: image
modelVersions.url: https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/51aade00-22b2-4038-bd46-2dd186b9ba55/width=450/28404818.jpeg
modelVersions.hash: UIDjJNn%R%sp}]jZWAbHt+azJ6bHcXaye.j[
modelVersions.type: image
modelVersions.url: https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/20e2be65-bbf9-4040-8e59-e69fd134c4ce/width=450/28404719.jpeg
modelVersions.hash: U25E]bWAogt8MvV@8^of%iWBRPogjDWB%Nt8
modelVersions.type: image
modelVersions.url: https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/7268e9b0-9997-45f6-9bf7-0767d66471d6/width=450/28404723.jpeg
modelVersions.hash: UjP?Kxt7~qt7w[fRS6j@-:fkE1f6o~fQslj[
modelVersions.type: image
modelVersions.url: https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/484b3f2f-b135-4887-8946-a0b7f9ce3076/width=450/28404851.jpeg
modelVersions.hash: UG8nnko1$5jt|wo1wxfQ,YjtWpa|sUfQN]fQ
modelVersions.type: image
modelVersions.url: https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/babb8900-624f-433b-8518-db8e9e123e6e/width=450/28404673.jpeg
modelVersions.hash: U~J7?Uoe-:of~Uj[t8j[xtayM|ayWYj[RjfQ
modelVersions.type: image
modelVersions.url: https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/0218131d-8fcc-4c72-8e5f-f9ff36ac696c/width=450/28404857.jpeg
modelVersions.hash: U*OgKNt7~qay%MWBayfQ-;t7M{ofRjayayay
modelVersions.type: image
modelVersions.url: https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/e51b3b61-649c-4cd3-9433-0686a4f9e3ea/width=450/28404728.jpeg
modelVersions.hash: UjK^j2WB_Nxa~Ts:NLj[jYj[NHWBkDWBWBa}
modelVersions.type: image
modelVersions.url: https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/27bebaaa-2758-4d13-ba73-a1664e158f06/width=450/28404858.jpeg
modelVersions.hash: UsLg^ZIU~q%M_3t7azt7_3ofRjj[ayayRjRj
modelVersions.type: image
modelVersions.url: https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/de929b14-799a-4b30-b8b1-5f706454cdce/width=450/28404753.jpeg
modelVersions.hash: U12657V=Dzxci?f.V;kD9DjD%OS1NQoHx|V;
modelVersions.type: image
modelVersions.url: https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/ac447a15-4a4d-4028-90ad-655815077c24/width=450/28404790.jpeg
modelVersions.hash: U95O+@H?M{.S?^IAMx.8%#MxRP%gtRV@WBtR
modelVersions.type: image
modelVersions.url: https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/6cd26d43-a446-4ce9-95f7-85b0ac4b4206/width=450/28404801.jpeg
modelVersions.hash: UoP$I7RP?vt7Y5RjoyjZ~CtRE0f+-pxaXRWB
modelVersions.type: image
modelVersions.url: https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/0034d4ec-2f19-4229-b943-ba04e067e111/width=450/28404803.jpeg
modelVersions.hash: UGAABqrq57V@~BrqEMV@R5e.ozkC9ZWX-pkW
modelVersions.type: image
modelVersions.url: https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/5e0b8a48-38e4-4b1b-9adc-6e9357221b3a/width=450/28404804.jpeg
modelVersions.hash: UmG[Duoe-;s:~AjskWj[sljtIpazt8j[R-a#
modelVersions.type: image
modelVersions.url: https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/2125219d-5bbb-438d-802c-25add382b1ad/width=450/28404853.jpeg
modelVersions.hash: U995sm2sNu|w9@wcj[JR71,ts9E}=INuSg,s
modelVersions.type: image
modelVersions.url: https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/efa1ee13-1fa6-46f1-addf-fb7a19a136f1/width=450/28404891.jpeg
modelVersions.hash: UqNc+foe~pt7^ioeogoL^*fQD+ayIqayRlaz
modelVersions.type: image
modelVersions.url: https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/e7d33cd9-2ce6-41e6-b742-da50cf6094db/width=450/28404879.jpeg
modelVersions.hash: U99iPT62Rk,G|^AWaf,s+|E#js-Aw{J7s:s.
modelVersions.type: image
modelVersions.url: https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/acb40399-d272-4558-aea5-5898d72ba112/width=450/28404880.jpeg
modelVersions.hash: U68:hoaK0}SO}tf75+f+Vts:OANut7xGWBI:
modelVersions.type: image
modelVersions.url: https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/d74f991f-142f-476f-b208-e530b79b608e/width=450/28404885.jpeg
modelVersions.name: v2.0
modelVersions.publishedAt: 2024-09-08T16:58:19.752Z
modelVersions.trainedWords: The Hunter The Hunter a character from bloodborne
name: Hunter - Bloodborne - LoRA Flux 1 Dev
tags: character bloodborne game charcter