รายละเอียด
แนะนำ
V2.0
v1.0
Tool that shuffles and picks x amount of prompts from input prompt file(s)

Tool that shuffles and picks x amount of prompts from input prompt file(s)

0
0
0
#เครื่องมือ
#เครื่องมือ

Updated 21.3.:

  • Support for multiple input files added

  • Extended sample range to 10 000 by default


Tool that helps with selecting a random amount of prompts from a file that contains prompts. I am using it when testing the different prompt packages I am uploading. I'll take a big enough sample to generate a few images. Remove and fix obvious maligned prompts, rinse and repeat.

Requirements

  • pip install gradio

Usage

  • gradio guitoolkit.py

  • or use python guitoolkit.py

How to guide

  1. Download this file / copy the code below into a file called guitoolkit.py (or whatever you want to call it)

  2. Make/use a virtual environment python -m venv venv

  3. Activate environment venv\Scripts\activate

  4. Run the command pip install gradio to install the gradio library which is required to use this

  5. When you have installed that, run either gradio guitoolkit.py or python guitoolkit.py

  6. You should now have the tool ready to use if you get the following: gradio .\guitoolkit.py
    launching in reload mode on: http://127.0.0.1:7861 (Press CTRL+C to quit)

  7. You can now visit http://127.0.0.1:7861 where the tool is ready to use

  8. Input the file(s) you want to shuffle, select how many you want, copy the output, insert it into e.g. Automatic1111


Source code

import gradio as gr
import random

def shuffle_file(file_obj, no_prompts):
    prompts = []
    for file in file_obj:
        with open(file.name) as infile:
            in_prompts = infile.readlines()
        prompts.extend(list(set(in_prompts)))
    
    prompts = random.sample(prompts, no_prompts)
    random.shuffle(prompts)
    print(type(prompts))
    return "".join(prompts)

demo = gr.Interface(
    fn=shuffle_file,
    inputs=["files",  gr.Slider(5, 10000)],
    outputs=["code"],
)

if __name__ == "__main__":
    demo.launch(server_port=9800)

ดูการแปล

การให้คะแนนและความคิดเห็น

-- /5
0 คะแนน

ยังไม่ได้รับคะแนนหรือความคิดเห็นเพียงพอ

no-data
ยังไม่มีข้อมูล
avatar
ประกาศ
2024-07-25
เผยแพร่โมเดล
2023-03-21
อัปเดตข้อมูลโมเดล
รายละเอียดโมเดล
ประเภท
Other
เวลาโพสต์
2023-03-21
โมเดลพื้นฐาน
Other
การแนะนำเวอร์ชัน

Added support for adding as many files as you want. Also extended prompt numbers to 10 000 by default. Shuffle away!

ขอบเขตการอนุญาต
แหล่งที่มา: civitai

1. สิทธิ์ของโมเดลที่โพสต์ซ้ำเป็นของผู้สร้างต้นฉบับ

2. ผู้สร้างต้นฉบับที่ต้องการรับรองโมเดล โปรดติดต่อเจ้าหน้าที่ SeaArt AI ผ่านช่องทางทางการ คลิกเพื่อรับรอง

ขอบเขตการอนุญาตสร้างสรรค์
ถ่ายทอดสดออนไลน์
ผสมผสาน
อนุญาตให้ดาวน์โหลด
ขอบเขตการอนุญาตเชิงพาณิชย์
รูปภาพที่สร้างขึ้นสามารถขายหรือใช้เพื่อวัตถุประสงค์ทางการค้า
อนุญาตให้โมเดลขายต่อหรือขายหลังจากการรวม
QR Code
ดาวน์โหลดแอป SeaArt
ดำเนินการสร้างสรรค์ด้วย AI ต่อไปบนมือถือ