tulpa-prompter 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +2 -1
- data/lib/tulpa-prompter.rb +31 -6
- data/lib/tulpa_prompter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 867ab87efc3a3655fae1be03b6f5b9e953a9edfaf2566ac191c2bc3b52d773c9
|
4
|
+
data.tar.gz: ce8697e0098318da3245ebf5486475bb7187f9574aa0b9ea50b448c48c20b0d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5274be0e1de701e0f5528ae45b82d238fb9b93f09685d4763d58c3b9b346d1b2fe6575c0167ed3c22734271ab1bcb425495224422eba2aefa73a0125c2e2ff09
|
7
|
+
data.tar.gz: 886511a804ddae7eb83f2d6308a2b18d4e7f09ad469dca74d144cf13dc9d3cd5d8e7207bb04800ed1f8a2208d7fe9e30bbea98e3e63c7a55f35742143db02a61
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/lib/tulpa-prompter.rb
CHANGED
@@ -4,19 +4,44 @@ module TulpaPrompter
|
|
4
4
|
class Error < StandardError; end
|
5
5
|
|
6
6
|
def self.call(options)
|
7
|
+
options[:format] ||= :deforum_colab
|
8
|
+
options[:format] = parse_format_options(options[:format]) if options[:format].is_a?(Symbol)
|
9
|
+
|
7
10
|
options[:interval] ||= 15
|
8
11
|
options[:interval] = options[:interval].to_i
|
9
|
-
options[:lines].shuffle! if options[:shuffle]
|
12
|
+
options[:lines].shuffle! if options[:shuffle].to_s.downcase == "true" || options[:shuffle].to_s == "1"
|
10
13
|
|
11
|
-
|
12
|
-
options[:lines].each_with_index do |line, index|
|
14
|
+
prompts = options[:lines].map.with_index do |line, index|
|
13
15
|
frame = index * options[:interval]
|
14
|
-
|
16
|
+
frame = "\"#{frame}\"" if options[:format][:frame] == :string
|
15
17
|
|
18
|
+
prompt = line.strip
|
16
19
|
prompt = options[:prefix].to_s + prompt + options[:suffix].to_s
|
17
20
|
prompt = prompt.gsub("\"", "\\\"")
|
18
|
-
|
21
|
+
|
22
|
+
" #{frame}: \"#{prompt}\""
|
19
23
|
end
|
20
|
-
|
24
|
+
|
25
|
+
output = ""
|
26
|
+
output << "#{options[:format][:assign]} = " if options[:format][:assign]
|
27
|
+
output << "{\n"
|
28
|
+
output << prompts.join(",\n")
|
29
|
+
output << "\n}"
|
30
|
+
|
31
|
+
output
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.parse_format_options(format)
|
35
|
+
format_options = {}
|
36
|
+
|
37
|
+
case format
|
38
|
+
when :deforum_webui
|
39
|
+
format_options[:frame] = :string
|
40
|
+
else
|
41
|
+
format_options[:assign] = "animation_prompts"
|
42
|
+
format_options[:frame] = :integer
|
43
|
+
end
|
44
|
+
|
45
|
+
format_options
|
21
46
|
end
|
22
47
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tulpa-prompter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dreaming Tulpa
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|