-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinferer.h
62 lines (45 loc) · 1.21 KB
/
inferer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef INFERER_H
#define INFERER_H
#include <QThread>
#include <QListWidgetItem>
#include "stablediffusionmodel.h"
#include "upscaler.h"
#include <QImage>
enum class StableDiffusionJobType{
Txt2Img,
Img2Img,
Upscale,
BulkUpscale,
Canvas
};
// An Voxer is a thread spawned for the sole purpose of doing inference
class Inferer : public QThread
{
Q_OBJECT
void run() override;
public:
Inferer();
void DoInference();
StableDiffusionModel* Model;
Upscaler* EsrGan;
Axodox::MachineLearning::StableDiffusionOptions Opts;
Axodox::Threading::async_operation_source* AsyncSrc;
QImage InputImage;
QImage InputMask;
std::string Prompt;
std::string NegativePrompt;
uint32_t BatchCount;
uint32_t SmoothnessWidth;
bool RandomSeed;
std::string OutputPath;
QListWidgetItem* itmInput;
int32_t GetStepsDone();
signals:
void DoneBulk(QImage Img, std::string OutputPath, QListWidgetItem* Itm);
void Done(QImage Img, StableDiffusionJobType JobType);
void ThreadFinished();
void PreviewsAvailable(std::vector<QImage> Prevs);
public slots:
void OnPreviewsAvailable(std::vector<Axodox::Graphics::TextureData> Previews);
};
#endif // INFERER_H